Code Monkey home page Code Monkey logo

Comments (17)

weilongheal avatar weilongheal commented on August 31, 2024

Caused by op 'cnn/conv/conv1d/Conv2D', defined at:
File "text_test.py", line 74, in
model = TextCNN(config)
File "/root/tensorflow/text_model.py", line 44, in init
self.cnn()
File "/root/tensorflow/text_model.py", line 52, in cnn
conv= tf.layers.conv1d(embedding_inputs, self.config.num_filters, self.config.kernel_size, name='conv')

from text-cnn.

cjymz886 avatar cjymz886 commented on August 31, 2024

出现“ResourceExhaustedError”一般是说超出内存了,应该是你的词表,内存支撑不了

from text-cnn.

weilongheal avatar weilongheal commented on August 31, 2024

但是我跑的是你用来的测试的那个数据集,词表是5000,应该没问题的吧,

from text-cnn.

cjymz886 avatar cjymz886 commented on August 31, 2024

你可以把vocab_size调小测试看看,是不是这个问题

from text-cnn.

weilongheal avatar weilongheal commented on August 31, 2024

不行,我是在GPU上跑的,vocab_size设置成3000还是同样的错误;我运行 text-rnn-cnn那个的时候值用了一个GPU,也没有遇到这个问题,现在vocab_size设置3000,4个GPU还是这个错误,所以我觉得不应该是内存的问题.

报错是这个:
conv= tf.layers.conv1d(embedding_inputs, self.config.num_filters, self.config.kernel_size, name='conv')
但是,我看着是没有问题的呀,train 没问题,test遇到问题了,

from text-cnn.

weilongheal avatar weilongheal commented on August 31, 2024

感谢大佬解答,

from text-cnn.

weilongheal avatar weilongheal commented on August 31, 2024

很奇怪的是,如果我指定CPU进行test的时候,很快,而且可以正常运行,

from text-cnn.

cjymz886 avatar cjymz886 commented on August 31, 2024

代码是在cpu环境跑的,gpu我没试过,可能跟这个有关系吧

from text-cnn.

agilelab avatar agilelab commented on August 31, 2024

代码在GPU上出错,前面有朋友也提出这个问题,能否修正一下?

from text-cnn.

cjymz886 avatar cjymz886 commented on August 31, 2024

代码在GPU上出错,前面有朋友也提出这个问题,能否修正一下?

from text-cnn.

agilelab avatar agilelab commented on August 31, 2024

代码在GPU上出错,前面有朋友也提出这个问题,能否修正一下?

非常感谢分享这样高质量的项目

from text-cnn.

cjymz886 avatar cjymz886 commented on August 31, 2024

代码在GPU上出错,前面有朋友也提出这个问题,能否修正一下?

非常感谢分享这样高质量的项目

我在GPU环境完成了测试,我是正常跑完的,我的GPU是16G,程序跑的时候用了约15G,你所出现的错误,我觉得应是GPU大小的问题;网上对这类错误的处理,说是将batch_size减少,我测试过将batch_size从64变为32,但发现程序运行时耗用的GPU大小并没有变化,具体在你们环境我就不能十分确定了;我建议还是切换到CPU下跑,训练的速度也是很快的。

我目前能做的就是这么多了,若有问题,我们再探讨。

from text-cnn.

Qinshimingyue23 avatar Qinshimingyue23 commented on August 31, 2024

请问我用cnn做句子分类为什么训练词向量时报RuntimeError: you must first build vocabulary before training the model,训练模型时报ValueError: zero-size array to reduction operation maximum which has no identity,是不能用您的代码做句子分类么?希望可以尽快得到您的回复 @cjymz886

from text-cnn.

cjymz886 avatar cjymz886 commented on August 31, 2024

from text-cnn.

Qinshimingyue23 avatar Qinshimingyue23 commented on August 31, 2024

我的语料库很少,就200多条,但是min_cout初始值就等于1啊,是不是其他参数也要改一下

from text-cnn.

cjymz886 avatar cjymz886 commented on August 31, 2024

from text-cnn.

Qinshimingyue23 avatar Qinshimingyue23 commented on August 31, 2024

from text-cnn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.