-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
error on tf.contrib.opt.ScipyOptimizerInterface #45
Comments
@AmirNoori68 you can just add |
@vldud-off Works fine. Thanks! |
where is helper.py and how to add ScipyOptimizerInterface ? |
First, download https://github.com/tensorflow/tensorflow/blob/876fc8dc4f40c75914dbfcb0a809feaf81be7412/tensorflow/contrib/opt/python/training/external_optimizer.py, give it a name like "helper.py" and put it in the main folder. next, add "from helper import ScipyOptimizerInterface" to the main code. Finally, replace the current Scipy optimizer ("tf.contrib.opt.ScipyOptimizerInterface") with the following code: |
Hi,
This code is based on the "TF1.X".
There is no way to get "TF1.X" anymore on either Google colab or Jupyter.
Just the "TF1.X" parts can be updated to "TF2.X" by two following lines:
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
But I still get error in "self.optimizer = tf.contrib.opt.ScipyOptimizerInterface()."
It says, "AttributeError: module 'tensorflow.compat.v1' has no attribute 'contrib' ."
The reason is that "tf.contrib" is not changed, but moved from tensorflow!
Can anyone help to solve this problem?
The text was updated successfully, but these errors were encountered: