Skip to content
This repository has been archived by the owner on Jul 7, 2023. It is now read-only.

Moving MNIST frame prediction using SV2P or Emily #1907

Open
pupul07 opened this issue Feb 12, 2022 · 0 comments
Open

Moving MNIST frame prediction using SV2P or Emily #1907

pupul07 opened this issue Feb 12, 2022 · 0 comments

Comments

@pupul07
Copy link

pupul07 commented Feb 12, 2022

Description

I want to use tensor2tensor for stochastic video generation. Specifically, I was looking to run SV2P or Emily on the moving MNIST dataset. This is the command I use to run my stuff:

t2t-trainer --generate_data --data_dir=~/t2t_data --output_dir=~/t2t_train/video_moving_mnist --problem=video_moving_mnist --model=video_sv2p --train_steps=1000 --eval_steps=100 --hparams_set=next_frame_sv2p

I keep getting the following error:
AttributeError: 'MapDataset' object has no attribute 'make_initializable_iterator'

I used many different versions of tensorflow but this error doesn't seem to go away. I'm not sure what I am doing wrong. :(
...

Environment information

OS: Mac OSX Big Sur 11.6

$ pip freeze | grep tensor
mesh-tensorflow==0.1.19
tensor2tensor==1.15.7
tensorboard==2.8.0
tensorboard-data-server==0.6.1
tensorboard-plugin-wit==1.8.1
tensorflow==2.5.0
tensorflow-addons==0.15.0
tensorflow-datasets==4.5.2
tensorflow-estimator==2.5.0
tensorflow-gan==2.1.0
tensorflow-hub==0.12.0
tensorflow-io-gcs-filesystem==0.24.0
tensorflow-metadata==1.6.0
tensorflow-probability==0.7.0

$ python -V
Python 3.9.5

For bugs: reproduction and error logs

# Steps to reproduce:
t2t-trainer --generate_data --data_dir=~/t2t_data --output_dir=~/t2t_train/video_moving_mnist --problem=video_moving_mnist --model=video_sv2p --train_steps=1000 --eval_steps=100 --hparams_set=next_frame_sv2p
# Error logs:
WARNING:tensorflow:From /opt/miniconda3/lib/python3.9/site-packages/tensorflow_gan/python/estimator/tpu_gan_estimator.py:42: The name tf.estimator.tpu.TPUEstimator is deprecated. Please use tf.compat.v1.estimator.tpu.TPUEstimator instead.

WARNING:tensorflow:From /opt/miniconda3/lib/python3.9/site-packages/tensorflow_gan/python/estimator/tpu_gan_estimator.py:42: The name tf.estimator.tpu.TPUEstimator is deprecated. Please use tf.compat.v1.estimator.tpu.TPUEstimator instead.

INFO:tensorflow:Generating data for video_moving_mnist
I0211 20:14:53.698021 4566695424 t2t_trainer.py:301] Generating data for video_moving_mnist
2022-02-11 20:14:53.790530: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  AVX2 FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
I0211 20:14:53.809851 4566695424 dataset_info.py:439] Load dataset info from /Users/chiradeep/tensorflow_datasets/mnist/3.0.1
I0211 20:14:53.814589 4566695424 dataset_info.py:492] Field info.citation from disk and from code do not match. Keeping the one from code.
I0211 20:14:53.817080 4566695424 dataset_info.py:492] Field info.splits from disk and from code do not match. Keeping the one from code.
I0211 20:14:53.817276 4566695424 dataset_info.py:492] Field info.supervised_keys from disk and from code do not match. Keeping the one from code.
I0211 20:14:53.817492 4566695424 dataset_info.py:492] Field info.module_name from disk and from code do not match. Keeping the one from code.
I0211 20:14:53.817956 4566695424 dataset_builder.py:369] Reusing dataset mnist (/Users/chiradeep/tensorflow_datasets/mnist/3.0.1)
I0211 20:14:53.818141 4566695424 logging_logger.py:44] Constructing tf.data.Dataset mnist for split train, from /Users/chiradeep/tensorflow_datasets/mnist/3.0.1
WARNING:tensorflow:From /opt/miniconda3/lib/python3.9/site-packages/tensorflow/python/util/deprecation.py:602: calling map_fn_v2 (from tensorflow.python.ops.map_fn) with dtype is deprecated and will be removed in a future version.
Instructions for updating:
Use fn_output_signature instead
W0211 20:14:54.451564 4566695424 deprecation.py:528] From /opt/miniconda3/lib/python3.9/site-packages/tensorflow/python/util/deprecation.py:602: calling map_fn_v2 (from tensorflow.python.ops.map_fn) with dtype is deprecated and will be removed in a future version.
Instructions for updating:
Use fn_output_signature instead
Traceback (most recent call last):
  File "/opt/miniconda3/bin/t2t-trainer", line 33, in <module>
    tf.app.run(main)
  File "/opt/miniconda3/lib/python3.9/site-packages/tensorflow/python/platform/app.py", line 40, in run
    _run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
  File "/opt/miniconda3/lib/python3.9/site-packages/absl/app.py", line 312, in run
    _run_main(main, args)
  File "/opt/miniconda3/lib/python3.9/site-packages/absl/app.py", line 258, in _run_main
    sys.exit(main(argv))
  File "/opt/miniconda3/bin/t2t-trainer", line 28, in main
    t2t_trainer.main(argv)
  File "/opt/miniconda3/lib/python3.9/site-packages/tensor2tensor/bin/t2t_trainer.py", line 409, in main
    generate_data()
  File "/opt/miniconda3/lib/python3.9/site-packages/tensor2tensor/bin/t2t_trainer.py", line 302, in generate_data
    registry.problem(problem_name).generate_data(data_dir, tmp_dir)
  File "/opt/miniconda3/lib/python3.9/site-packages/tensor2tensor/data_generators/video_utils.py", line 651, in generate_data
    generator_utils.generate_files(
  File "/opt/miniconda3/lib/python3.9/site-packages/tensor2tensor/data_generators/generator_utils.py", line 174, in generate_files
    for case in generator:
  File "/opt/miniconda3/lib/python3.9/site-packages/tensor2tensor/data_generators/video_utils.py", line 600, in generate_encoded_samples
    for features in self.generate_samples(data_dir, tmp_dir, dataset_split):
  File "/opt/miniconda3/lib/python3.9/site-packages/tensor2tensor/data_generators/moving_mnist.py", line 140, in generate_samples
    moving_ds = self.get_train_iterator()
  File "/opt/miniconda3/lib/python3.9/site-packages/tensor2tensor/data_generators/moving_mnist.py", line 131, in get_train_iterator
    return moving_mnist_ds.make_initializable_iterator()
AttributeError: 'MapDataset' object has no attribute 'make_initializable_iterator'
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