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

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

@jerofree

Description

@jerofree

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions