DocProduct icon indicating copy to clipboard operation
DocProduct copied to clipboard

ImportError: cannot import name 'dense_features'

Open shari-amalgamrx opened this issue 3 years ago • 6 comments

Unable to import the package. The solution seems to be to update the tf but then its throwing an error that the DocProduct doesn't support tf==2.1

Failed to load GPU Faiss: No module named 'faiss.swigfaiss_gpu' Faiss falling back to CPU-only.

ImportError Traceback (most recent call last) in () 1 #@title Import and initalize the fine-tuned GPT2 generator. Double-click to see code. 2 ----> 3 from docproduct.predictor import GenerateQADoc 4 5 pretrained_path = 'BioBertFolder/biobert_v1.0_pubmed_pmc/'

8 frames /usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/canned/dnn.py in () 21 import six 22 ---> 23 from tensorflow.python.feature_column import dense_features 24 from tensorflow.python.feature_column import dense_features_v2 25 from tensorflow.python.feature_column import feature_column

ImportError: cannot import name 'dense_features'


NOTE: If your import is failing due to a missing package, you can manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the "Open Examples" button below.

shari-amalgamrx avatar Aug 13 '20 19:08 shari-amalgamrx

faiss is seperate from Tensorflow, did you double check to make sure it's being installed ok?

Santosh-Gupta avatar Aug 18 '20 06:08 Santosh-Gupta

@Santosh-Gupta Yes I did install the updated version. Still unable to run the colab? Do you by any chance happen to have a step by step instruction to run the notebook? That would be really helpful. Thank you

shari-amalgamrx avatar Aug 18 '20 12:08 shari-amalgamrx

It should run by executing the cells in order. Which notebook are you trying, there were a couple in the readme.

Santosh-Gupta avatar Aug 18 '20 18:08 Santosh-Gupta

I was able to run the model that just retrieves a sentence. Even that had some dependency issues. But I am unable to run the notebook that uses gpt2

shari-amalgamrx avatar Aug 18 '20 18:08 shari-amalgamrx

ahh, that's @ash3n 's , maybe he can give some insight.

Santosh-Gupta avatar Aug 19 '20 00:08 Santosh-Gupta

If we don't hear from him, I recommend switching over to the huggingface transformers library, it is much better supported

Santosh-Gupta avatar Aug 21 '20 15:08 Santosh-Gupta