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

module 'tensorflow' has no attribute 'Dataset' #45

Open
AlexRMU opened this issue Nov 9, 2020 · 1 comment
Open

module 'tensorflow' has no attribute 'Dataset' #45

AlexRMU opened this issue Nov 9, 2020 · 1 comment

Comments

@AlexRMU
Copy link

AlexRMU commented Nov 9, 2020

!python watermarks.py --image assets/cat.png --selection assets/cat-selection.png --dataset=dataset_cifar --batch_size 32

WARNING:tensorflow:From watermarks.py:298: The name tf.app.run is deprecated. Please use tf.compat.v1.app.run instead.

WARNING:tensorflow:From watermarks.py:282: The name tf.Session is deprecated. Please use tf.compat.v1.Session instead.

W1109 16:02:22.012408 140498710181760 deprecation_wrapper.py:119] From watermarks.py:282: The name tf.Session is deprecated. Please use tf.compat.v1.Session instead.

2020-11-09 16:02:22.025011: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2020-11-09 16:02:22.028714: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2249995000 Hz
2020-11-09 16:02:22.028934: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x32032c0 executing computations on platform Host. Devices:
2020-11-09 16:02:22.028963: I tensorflow/compiler/xla/service/service.cc:175]   StreamExecutor device (0): <undefined>, <undefined>
Traceback (most recent call last):
  File "watermarks.py", line 298, in <module>
    tf.app.run()
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/platform/app.py", line 40, in run
    _run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
  File "/usr/local/lib/python3.6/dist-packages/absl/app.py", line 300, in run
    _run_main(main, args)
  File "/usr/local/lib/python3.6/dist-packages/absl/app.py", line 251, in _run_main
    sys.exit(main(argv))
  File "watermarks.py", line 289, in main
    lambda: dataset_paths([FLAGS.selection]))
  File "watermarks.py", line 117, in inference
    next_image, iterator_init = dataset()
  File "watermarks.py", line 286, in <lambda>
    lambda: dataset_paths([FLAGS.image]),
  File "/content/cnn-watermark-removal/dataset.py", line 50, in dataset_paths
    dataset = tf.Dataset.from_tensor_slices(tf.constant(paths))
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/util/deprecation_wrapper.py", line 106, in __getattr__
    attr = getattr(self._dw_wrapped_module, name)
AttributeError: module 'tensorflow' has no attribute 'Dataset'
@SY573M404
Copy link

I think Dataset has moved in last Tensorflow versions. You can just replace tf.Dataset with tf.data.Dataset

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