Giter Club home page Giter Club logo

Comments (8)

jiesutd avatar jiesutd commented on August 15, 2024

Hi @qiuwei thanks for the suggestion.

Can you give a more detail description about the flush operator? As I already used several sys.stdout.flush() to force the system print the logs.

from ncrfpp.

qiuwei avatar qiuwei commented on August 15, 2024

If I use ncrfpp with python3, the log is not written to the stdout immediately as with python 2.
That's default behavior at the moment if don't make any modifications to the code at the moment.

With the sample data, it's hard to notice though. On my own dataset, I noticed the log was flushed only after every 20ish epochs.

from ncrfpp.

UPWHY avatar UPWHY commented on August 15, 2024

Traceback (most recent call last):
File "main.py", line 438, in
train(data)
File "main.py", line 328, in train
batch_word, batch_features, batch_wordlen, batch_wordrecover, batch_char, batch_charlen, batch_charrecover, batch_label, mask = batchify_with_label(instance, data.HP_gpu)
File "main.py", line 236, in batchify_with_label
mask[idx, :seqlen] = torch.Tensor([1]*seqlen)
TypeError: mul() received an invalid combination of arguments - got (list), but expected one of:

  • (Tensor other)
    didn't match because some of the arguments have invalid types: (list)
  • (float other)
    didn't match because some of the arguments have invalid types: (list)

from ncrfpp.

nthoangcute avatar nthoangcute commented on August 15, 2024

Epoch: 0/1
Learning rate is set as: 0.015
Traceback (most recent call last):
File "main.py", line 438, in
train(data)
File "main.py", line 328, in train
batch_word, batch_features, batch_wordlen, batch_wordrecover, batch_char, batch_charlen, batch_charrecover, batch_label, mask = batchify_with_label(instance, data.HP_gpu)
File "main.py", line 236, in batchify_with_label
mask[idx, :seqlen] = torch.Tensor([1]*seqlen)
TypeError: mul() received an invalid combination of arguments - got (list), but expected one of:

  • (Tensor other)
    didn't match because some of the arguments have invalid types: (list)
  • (Number other)
    didn't match because some of the arguments have invalid types: (list)

from ncrfpp.

jiesutd avatar jiesutd commented on August 15, 2024

@nthoangcute please confirm you used the right PyTorch version. PyTorch 0.3

from ncrfpp.

nthoangcute avatar nthoangcute commented on August 15, 2024

@jiesutd opss! My pytorch is currently 0.5.0a0.

Traceback (most recent call last):
  File "main.py", line 440, in <module>
    train(data)
  File "main.py", line 284, in train
    model = SeqModel(data)
  File "/root/vietbt/NCRFpp/model/seqmodel.py", line 31, in __init__
    self.word_hidden = WordSequence(data)
  File "/root/vietbt/NCRFpp/model/wordsequence.py", line 71, in __init__
    self.lstm = self.lstm.cuda()
  File "/opt/conda/lib/python3.6/site-packages/torch/nn/modules/module.py", line 258, in cuda
    return self._apply(lambda t: t.cuda(device))
  File "/opt/conda/lib/python3.6/site-packages/torch/nn/modules/rnn.py", line 112, in _apply
    self.flatten_parameters()
  File "/opt/conda/lib/python3.6/site-packages/torch/nn/modules/rnn.py", line 105, in flatten_parameters
    self.batch_first, bool(self.bidirectional))
RuntimeError: CuDNN error: CUDNN_STATUS_INTERNAL_ERROR

Maybe I have to downgrade my pytorch version to 0.3

from ncrfpp.

jiesutd avatar jiesutd commented on August 15, 2024

@UPWHY please use the PyTorch 0.3 version.

from ncrfpp.

siyecaoh avatar siyecaoh commented on August 15, 2024

我现在用的Python是2.7,pytorch是0.3,但是还是报错:Traceback (most recent call last):
File "main.py", line 438, in
train(data)
File "main.py", line 328, in train
batch_word, batch_features, batch_wordlen, batch_wordrecover, batch_char, batch_charlen, batch_charrecover, batch_label, mask = batchify_with_label(instance, data.HP_gpu)
File "main.py", line 236, in batchify_with_label
mask[idx, :seqlen] = torch.Tensor([1]*seqlen)
TypeError: mul() received an invalid combination of arguments - got (list), but expected one of:

  • (Tensor other)
    didn't match because some of the arguments have invalid types: (list)
  • (Number other)
    didn't match because some of the arguments have invalid types: (list)

from ncrfpp.

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.