bert_document_classification icon indicating copy to clipboard operation
bert_document_classification copied to clipboard

cannot import name '_VF'

Open Jheel-patel opened this issue 5 years ago • 2 comments

Receiving following error on running

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-10-19a3cb46662e> in <module>()
----> 1 from bert_document_classification.models import SmokerPhenotypingBert
      2 from bert_document_classification.models import ObesityPhenotypingBert
      3 
      4 smoking_classifier = SmokerPhenotypingBert(device='cuda', batch_size=10) #defaults to GPU prediction
      5 

4 frames
/usr/local/lib/python3.6/dist-packages/bert_document_classification/transformer.py in <module>()
     13 from torch.nn.init import xavier_normal_
     14 from torch.nn.parameter import Parameter
---> 15 from torch.nn import _VF
     16 
     17 def _get_softmax_dim(name, ndim, stacklevel):

ImportError: cannot import name '_VF'

Jheel-patel avatar Dec 07 '20 20:12 Jheel-patel

@Jheel-patel did you have any news about this issue? I got the same here.

antonioFlavio avatar Jan 05 '21 19:01 antonioFlavio

I got the same error when running with torch version 1.6.0. When I change to use the torch version 1.4.0, the problem was solved.

iamhere1 avatar Feb 17 '21 05:02 iamhere1