Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: cannot import name 'dense_features' #29

Open
shari-amalgamrx opened this issue Aug 13, 2020 · 6 comments
Open

ImportError: cannot import name 'dense_features' #29

shari-amalgamrx opened this issue Aug 13, 2020 · 6 comments

Comments

@shari-amalgamrx
Copy link

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.

@Santosh-Gupta
Copy link
Member

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

@shari-amalgamrx
Copy link
Author

@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

@Santosh-Gupta
Copy link
Member

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

@shari-amalgamrx
Copy link
Author

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

@Santosh-Gupta
Copy link
Member

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

@Santosh-Gupta
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants