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

tensorflow 2.3.1 incompatibility #27

Open
jakob-r opened this issue Dec 11, 2020 · 1 comment
Open

tensorflow 2.3.1 incompatibility #27

jakob-r opened this issue Dec 11, 2020 · 1 comment

Comments

@jakob-r
Copy link

jakob-r commented Dec 11, 2020

Trying out the example I get the following error.

In [7]: from nasbench import api
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-7-5ba3f4b880ca> in <module>
----> 1 from nasbench import api

~/dump/nasbench/nasbench/api.py in <module>
     96 
     97 from nasbench.lib import config
---> 98 from nasbench.lib import evaluate
     99 from nasbench.lib import model_metrics_pb2
    100 from nasbench.lib import model_spec as _model_spec

~/dump/nasbench/nasbench/lib/evaluate.py in <module>
     22 
     23 from nasbench.lib import cifar
---> 24 from nasbench.lib import model_builder
     25 from nasbench.lib import training_time
     26 import numpy as np

~/dump/nasbench/nasbench/lib/model_builder.py in <module>
     29 
     30 from nasbench.lib import base_ops
---> 31 from nasbench.lib import training_time
     32 import numpy as np
     33 import tensorflow as tf

~/dump/nasbench/nasbench/lib/training_time.py in <module>
    128 
    129 
--> 130 class _TimingRunHook(tf.train.SessionRunHook):
    131   """Hook to stop the training after a certain amount of time."""
    132 

AttributeError: module 'tensorflow._api.v2.train' has no attribute 'SessionRunHook'
@ThomasBas
Copy link

I found a workaround by replacing 'train' with 'estimator' (tf.estimator.SessionRunHook) in the training_time.py file.

It will also raise a similar error for 'tf.train.CheckpointSaverListener' in training_time.py - line:174 and for 'tf.train.NanLossDuringTrainingError' in evaluate.py - line:30. Again replacing 'train' with 'estimator' should fix this for now.

Finally, in api.py replacing 'tf.python_io.tf_record_iterator' with 'tf.compat.v1.io.tf_record_iterator' should allow you to run example.py. Hope this helps!

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