C1W3 Run the TensorFlow.js Converter on The Saved Keras Model Error

I created a new Anaconda Environment following tips from other posts as followed:

  1. conda create -n tf210 tensorflow=2.1.0 python=3.7
  2. conda activate tf210
  3. pip install tensorflowjs
  4. pip install keras
  5. pip install matplotlib
  6. conda deactivate

This allowed me to get through all the assignment except the last question. When I try to run !tensorflowjs_converter --input_format=keras {saved_model_path} ./ I get the following error: AttributeError: module 'tensorflow_core.compat.v1' has no attribute 'estimator'.

I would really appreciate it if someone could help me figure out why I’m getting this error.

The above steps is the closest I have gotten to getting the outdated assignment to work. Also, when I try to use pip install tensorflow==2.2.0 on the Anaconda Environment tf210 I get a bunch of errors. So, that is why I’m sticking with 2.1.0. Similarly, I’ve noticed that Google Colab doesn’t allow you to pip install any Tensorflow version prior to 2.5.0.

I was able to fix this, finally! For anyone else who could face this issue, I hope the following information is useful. In short, this is what I ended up with regarding tensorflow.

Screenshot 2023-03-13 172141

I first created a conda environment with python=3 and tensorflow=2.0.0, but when I used pip install tensorflowjs==2.0 I started getting errors with tensorflow-estimator. There was a lot of playing around with various packages and their versions, but I think the 4 major changes are as follow. Note their order.

  1. pip install tensorflow-intel==0.0.1
  2. pip install tensorflow-cpu==2.1.0
  3. pip install tensorflow-estimator==2.1.0rc0
  4. pip install tensorflow==2.2.0

These four steps were the last things I did on the anaconda prompt and it was able to resolve my issue. This was after I created the conda environment with python, tensorflow, and tensorflowjs. So yes, I did install tensorflow twice. I still received package compatibility issues, but I was able to successfully complete the assignment.

1 Like

@Jan_Danel , I just tried these steps and it worked. I could successfully complete the assignment. Thank you so much for sharing your setup.

@Girijesh , you may want to add this setup to to the assignment.

1 Like

Dear Seema,
Is your problem solved?

Yes, @Girijesh . The steps outlined by @Jan_Danel worked for me.

1 Like