Skip to content

Running the train.py file gives an error. I don't know what to do. Please help. tensorflow-gpu==1.15.0, python==3.7.12 #62

@capp-adocia

Description

@capp-adocia
Total size of variables: 1558304
Total bytes of variables: 6233216
WARNING:tensorflow:From C:\Users\Administrator\Desktop\AnimeGANv3-master\AnimeGANv3_hayao.py:170: The name tf.global_variables_initializer is deprecated. Please use tf.compat.v1.global_variables_initializer instead.      

WARNING:tensorflow:From C:\Users\Administrator\Desktop\AnimeGANv3-master\AnimeGANv3_hayao.py:174: The name tf.train.Saver is deprecated. Please use tf.compat.v1.train.Saver instead.

 [*] Reading checkpoints...
 [*] Failed to find a checkpoint
 [!] Load failed...
Traceback (most recent call last):
  File "C:\Application\Anconda\envs\tf-gpu\lib\site-packages\tensorflow_core\python\client\session.py", line 305, in __init__
    fetch, allow_tensor=True, allow_operation=True))
  File "C:\Application\Anconda\envs\tf-gpu\lib\site-packages\tensorflow_core\python\framework\ops.py", line 3607, in as_graph_element
    return self._as_graph_element_locked(obj, allow_tensor, allow_operation)
  File "C:\Application\Anconda\envs\tf-gpu\lib\site-packages\tensorflow_core\python\framework\ops.py", line 3696, in _as_graph_element_locked
    (type(obj).__name__, types_str))
TypeError: Can not convert a DatasetV1Adapter into a Tensor or Operation.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "train.py", line 89, in <module>
    train()
  File "train.py", line 83, in train
    gan.train()
  File "C:\Users\Administrator\Desktop\AnimeGANv3-master\AnimeGANv3_hayao.py", line 197, in train
    real_photo, anime_, anime_smooth_ = self.sess.run([real_photo_op, anime_img_op, anime_smooth_op])
  File "C:\Application\Anconda\envs\tf-gpu\lib\site-packages\tensorflow_core\python\client\session.py", line 956, in run
    run_metadata_ptr)
  File "C:\Application\Anconda\envs\tf-gpu\lib\site-packages\tensorflow_core\python\client\session.py", line 1165, in _run
    self._graph, fetches, feed_dict_tensor, feed_handles=feed_handles)
  File "C:\Application\Anconda\envs\tf-gpu\lib\site-packages\tensorflow_core\python\client\session.py", line 474, in __init__
    self._fetch_mapper = _FetchMapper.for_fetch(fetches)
  File "C:\Application\Anconda\envs\tf-gpu\lib\site-packages\tensorflow_core\python\client\session.py", line 266, in for_fetch
    return _ListFetchMapper(fetch)
  File "C:\Application\Anconda\envs\tf-gpu\lib\site-packages\tensorflow_core\python\client\session.py", line 375, in __init__
    self._mappers = [_FetchMapper.for_fetch(fetch) for fetch in fetches]
  File "C:\Application\Anconda\envs\tf-gpu\lib\site-packages\tensorflow_core\python\client\session.py", line 375, in <listcomp>
    self._mappers = [_FetchMapper.for_fetch(fetch) for fetch in fetches]
  File "C:\Application\Anconda\envs\tf-gpu\lib\site-packages\tensorflow_core\python\client\session.py", line 276, in for_fetch
    return _ElementFetchMapper(fetches, contraction_fn)
  File "C:\Application\Anconda\envs\tf-gpu\lib\site-packages\tensorflow_core\python\client\session.py", line 309, in __init__
    (fetch, type(fetch), str(e)))
TypeError: Fetch argument <DatasetV1Adapter shapes: (<unknown>, <unknown>), types: (tf.float32, tf.float32)> has invalid type <class 'tensorflow.python.data.ops.dataset_ops.DatasetV1Adapter'>, must be a string or Tensor. 
(Can not convert a DatasetV1Adapter into a Tensor or Operation.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions