kmkurn / pytorch-crf

(Linear-chain) Conditional random field in PyTorch.
https://pytorch-crf.readthedocs.io
MIT License
935 stars 151 forks source link

“No module named 'torchcrf' ” under linux system #111

Closed AndyChinghaha closed 1 year ago

AndyChinghaha commented 1 year ago

Hi, my code is alright runing under windows pycharm, but meet this problem under linux,my linux env has install torchcrf with "pip install pytorchcrf",this comes out while deployting.

I check this with "pip show TorchCRF /torchcrf" and get 'Package(s) not found'.Then command line "pip list " to show that "pytorch-crf 0.7.2" , but "import pythorch-crf" which is a 'SyntaxError: invalid syntax' coming with '-' won't be ok.

AndyChinghaha commented 1 year ago

it seems a problem of packages managing, I saw the folder name as torchcrf under linuxs path site-packages.

kmkurn commented 1 year ago

Hi, yes you should import using from torchcrf import CRF as instructed on the docs.