Skip to content
This repository has been archived by the owner on Nov 10, 2022. It is now read-only.

the code could not be run under tf2.0 #14

Open
jerofree opened this issue Oct 14, 2021 · 0 comments
Open

the code could not be run under tf2.0 #14

jerofree opened this issue Oct 14, 2021 · 0 comments

Comments

@jerofree
Copy link

I try to change code “data_in = self.train_data.make_one_shot_iterator().get_next()” to “for data_in in self.train_data:”,

then below error occur.

/content/gdrive/MyDrive/Colab Notebooks/acai-master/lib/train.py:136 train  *
    for data_in in self.train_data:
/usr/local/lib/python3.7/dist-packages/tensorflow/python/autograph/operators/control_flow.py:422 for_stmt
    iter_, extra_test, body, get_state, set_state, symbol_names, opts)
/usr/local/lib/python3.7/dist-packages/tensorflow/python/autograph/operators/control_flow.py:727 _tf_dataset_for_stmt
    _verify_loop_init_vars(init_vars, symbol_names)
/usr/local/lib/python3.7/dist-packages/tensorflow/python/autograph/operators/control_flow.py:191 _verify_loop_init_vars
    raise ValueError(error_msg)

ValueError: 'self.sess' may not be None before the loop.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant