SeanNaren / warp-ctc

Pytorch Bindings for warp-ctc
Apache License 2.0
756 stars 271 forks source link

ImportError: cannot import name '_assert_no_grad' #96

Closed gbolin closed 5 years ago

gbolin commented 5 years ago

hello friends, I met the following problem: "from warpctc_pytorch import CTCLoss" get a error:

Traceback (most recent call last): File "crnn_new.py", line 20, in from warpctc_pytorch import CTCLoss File "/usr/local/lib/python3.5/site-packages/warpctc_pytorch-0.1-py3.5-linux-x86_64.egg/warpctc_pytorch/init.py", line 6, in from torch.nn.modules.loss import _assert_no_grad ImportError: cannot import name '_assert_no_grad'

my pytorch version 0.4.1, but 0.4.0 works well. so it relates to the pytorch version ?

SeanNaren commented 5 years ago

Try using https://github.com/SeanNaren/warp-ctc/tree/0.4.1

mohamad-hasan-sohan-ajini commented 5 years ago

Hello @SeanNaren

I get the same error installing warp-ctc from current master branch:

aj@aj-pc:~/repo/warp-ctc/pytorch_binding/tests$ python test_gpu.py Traceback (most recent call last): File "test_gpu.py", line 2, in import warpctc_pytorch as warp_ctc File "/usr/local/lib/python3.5/dist-packages/warpctc_pytorch/init.py", line 6, in from torch.nn.modules.loss import _assert_no_grad ImportError: cannot import name '_assert_no_grad'

I think merging jinserk pull request will solve issues with pytorch1.0, but it's not!