I have Tensorflow 1.6 and Python 3.7
I get the following error when I run some code:
ImportError: cannot import name 'dense_features' from 'tensorflow.python.feature_column'`
How can I resolve this?
Try reinstalling TensorFlow. Install tensorflow's latest version. It will resolve the issue.
I was getting same error while importing tensorflow_hub.
Was able to resolve this issue after upgrading Tensorflow.
pip install --upgrade tensorflow
Related
This error keeps popping up when I try to import tensorflow as tf ..
It's stuck from From old code in which I used this :
tensorflow.python.keras.utils.generic_utils
I think it's stored somewhere and is repeated to me from memory but I don't have experience with Python so I can't find an explanation.
Uninstall the tf-nightly packages and then try like below,
pip uninstall tf-nightly
pip install tensorflow --upgrade --force-reinstall
I imported sklearn DecisionBoundaryDisplay via the below command in my Google Colab file.
from sklearn.inspection import DecisionBoundaryDisplay
And I'm getting the following error.
ImportError: cannot import name 'DecisionBoundaryDisplay' from 'sklearn.inspection'
I even installed the following packages & also tried by restarting my runtime but still I'm getting the error.
!pip install --upgrade scikit-learn
!pip install scipy
!pip3 install -U scikit-learn scipy matplotlib
How to fix this issue?
what worked for me was installing scikit learn 1.1.0, i had version 1.0.2 before and got the same error you're encountering.
pip install -U scikit-learn --user
Hope it helps.
It seems DecisionBoundaryDisplay is a new feature and it is currently in an unstable development version. To use it, you need to install the nightly build.
I tried to install tensorflow_federated in google colab. I used
pip install --quiet tensorflow-federated-nightly
import tensorflow-federated as tff
and it worked. but now when I try to import it get this error:
AttributeError: module 'keras.api._v2.keras.experimental' has no attribute 'PeepholeLSTMCell'
I don't know why I get this error, because I didn't have any problem before.
I also used the following code to install tensorflow-federated:
pip install --upgrade tensorflow-federated-nightly
but I get the same error.
How do I fix it?
My versions are:
tensorflow 2.8.0,
keras 2.8.0,
tensorflow-federated-nightly 0.19.0.dev20220218
To use TensorFlow Federated with TensorFlow 2.8.0, please try the newly released version of TFF 0.20.0 pypi, github.
The tensorflow-federated-nightly package depends on the nightly versions of TensorFlow (tf-nightly), Keras (keras-nightly) and so on.
I want to import transformers in jupyter notebook but I get the following error. What is the reason for this error? My Python version is 3.8
ImportError: cannot import name 'TypeAlias' from 'typing_extensions'
I also updated the typing-extensions library version, but the problem was not resolved
You could try
pip install typing-extensions --upgrade
maybe the probelm is the version of datasets package:
pip install datasets==1.15
TypeAlias is available from python version 3.10.
You should upgrade your python version to avoid the error.
I have been using the following code to get the default Cora dataset provided by DGL, but the following error suddenly occurred today.
The code was runned in CoLab (python 3.7 and Pytorch backend). I believed this is a error from the DGL update (since it had worked all the time before). However, I just wonder if there is anything we can do on our end to fix this?
Thanks.
It seems that an error is from torch update to 1.10.0. Reinstalling torch to 1.9.1 works for me. You can reinstall torch in colab as follows:
!pip install dgl==0.6.1
!pip install torch==1.9.1
import dgl
cora = dgl.data.CoraGraphDataset()
installing the last GPU accelerated(cuda 11.1) dgl with pip install dgl-cu111 -f https://data.dgl.ai/wheels/repo.html