Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error on tensorflow cannot import name 'export_saved_model'

I keep getting this error when importing tensorflow as tf with the below error text:

ImportError: cannot import name 'export_saved_model' from 'tensorflow.python.keras.saving.saved_model'

Code used is simply:

import tensorflow as tf

I have done:

  1. uninstalled and installed tensorflow through pip and condo via anaconda cmd prompt
  2. Restarted and cleared outputs from kernel, closing the jupyternotebook and restarting my computer

Code used for tensorflow unstallation:

  1. pip uninstall tensorflow or
  2. conda uninstall -y tensorflow

Code used for tensorflow installation:

  1. pip install tensorflow or
  2. conda install tensorflow

I can't seem to figure why it keeps saying:

"ImportError: cannot import name 'export_saved_model' from 'tensorflow.python.keras.saving.saved_model'"

like image 722
PythNoob Avatar asked May 16 '20 07:05

PythNoob


1 Answers

Uninstalling and install again worked for me.

conda activate tf
pip uninstall -y tensorflow-gpu
pip install tensorflow-gpu

However, am still looking for the cause of this error. It was working just a few minutes ago but suddenly I have faced this error.

like image 90
hosh0425 Avatar answered Oct 22 '22 18:10

hosh0425