question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problem with "Train your first model" code

See original GitHub issue

Hi,

I successfully installed VSR. However when I try to run

python run.py --model=srcnn --dataset=91-image --test=set14

I encounter an error. The traceback reads:

WARNING:tensorflow:From /home/david/miniconda/lib/python3.7/site-packages/tensorflow/python/framework/op_def_library.py:263: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version. Instructions for updating: Colocations handled automatically by placer. WARNING:tensorflow:From /home/david/SAT-FIRE/Codes/Data Fusion/SCRNN with Tensorflow Example/VideoSuperResolution-master/VSR/Framework/SuperResolution.py:118: to_float (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version. Instructions for updating: Use tf.cast instead. WARNING:tensorflow:From /home/david/SAT-FIRE/Codes/Data Fusion/SCRNN with Tensorflow Example/VideoSuperResolution-master/VSR/Util/Utility.py:139: to_int32 (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version. Instructions for updating: Use tf.cast instead. 2019-04-25 11:22:29.679578: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA 2019-04-25 11:22:29.700841: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 3100230000 Hz 2019-04-25 11:22:29.701348: I tensorflow/compiler/xla/service/service.cc:150] XLA service 0x55cebbc55a80 executing computations on platform Host. Devices: 2019-04-25 11:22:29.701364: I tensorflow/compiler/xla/service/service.cc:158] StreamExecutor device (0): <undefined>, <undefined> INFO:tensorflow:Fitting: SRCNN frames is empty. [size=12800] | 2019-04-25 11:22:29 | Epoch: 1/50 | LR: 0.01 | 0batch [00:00, ?batch/s] frames is empty. [size=10] Test: 0it [00:00, ?it/s]

Traceback (most recent call last): File “/home/david/miniconda/lib/python3.7/site-packages/tensorflow/python/client/session.py”, line 1334, in _do_call return fn(*args) File “/home/david/miniconda/lib/python3.7/site-packages/tensorflow/python/client/session.py”, line 1319, in _run_fn options, feed_dict, fetch_list, target_list, run_metadata) File “/home/david/miniconda/lib/python3.7/site-packages/tensorflow/python/client/session.py”, line 1407, in _call_tf_sessionrun run_metadata) tensorflow.python.framework.errors_impl.InvalidArgumentError: You must feed a value for placeholder tensor ‘input/lr’ with dtype uint8 and shape [?,?,?,?] [[{{node input/lr}}]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File “run.py”, line 46, in <module> tf.app.run(main) File “/home/david/miniconda/lib/python3.7/site-packages/tensorflow/python/platform/app.py”, line 125, in run _sys.exit(main(argv)) File “run.py”, line 42, in main return Run.run(*args[0][1:], **additional_functions) File “/home/david/SAT-FIRE/Codes/Data Fusion/SCRNN with Tensorflow Example/VideoSuperResolution-master/VSR/Tools/Run.py”, line 319, in run t.fit([train_loader, val_loader], train_config) File “/home/david/SAT-FIRE/Codes/Data Fusion/SCRNN with Tensorflow Example/VideoSuperResolution-master/VSR/Framework/Trainer.py”, line 356, in fit self.fn_train_each_epoch() File “/home/david/SAT-FIRE/Codes/Data Fusion/SCRNN with Tensorflow Example/VideoSuperResolution-master/VSR/Framework/Trainer.py”, line 272, in fn_train_each_epoch v.summary_writer.add_summary(self.model.summary(), v.global_step) File “/home/david/SAT-FIRE/Codes/Data Fusion/SCRNN with Tensorflow Example/VideoSuperResolution-master/VSR/Framework/SuperResolution.py”, line 216, in summary feed_dict=self.feed_dict) File “/home/david/miniconda/lib/python3.7/site-packages/tensorflow/python/client/session.py”, line 929, in run run_metadata_ptr) File “/home/david/miniconda/lib/python3.7/site-packages/tensorflow/python/client/session.py”, line 1152, in _run feed_dict_tensor, options, run_metadata) File “/home/david/miniconda/lib/python3.7/site-packages/tensorflow/python/client/session.py”, line 1328, in _do_run run_metadata) File “/home/david/miniconda/lib/python3.7/site-packages/tensorflow/python/client/session.py”, line 1348, in _do_call raise type(e)(node_def, op, message) tensorflow.python.framework.errors_impl.InvalidArgumentError: You must feed a value for placeholder tensor ‘input/lr’ with dtype uint8 and shape [?,?,?,?] [[node input/lr (defined at /home/david/SAT-FIRE/Codes/Data Fusion/SCRNN with Tensorflow Example/VideoSuperResolution-master/VSR/Framework/SuperResolution.py:117) ]]

Caused by op ‘input/lr’, defined at: File “run.py”, line 46, in <module> tf.app.run(main) File “/home/david/miniconda/lib/python3.7/site-packages/tensorflow/python/platform/app.py”, line 125, in run _sys.exit(main(argv)) File “run.py”, line 42, in main return Run.run(*args[0][1:], **additional_functions) File “/home/david/SAT-FIRE/Codes/Data Fusion/SCRNN with Tensorflow Example/VideoSuperResolution-master/VSR/Tools/Run.py”, line 305, in run with trainer(model, root, verbosity) as t: File “/home/david/SAT-FIRE/Codes/Data Fusion/SCRNN with Tensorflow Example/VideoSuperResolution-master/VSR/Framework/Trainer.py”, line 109, in enter self._startup() File “/home/david/SAT-FIRE/Codes/Data Fusion/SCRNN with Tensorflow Example/VideoSuperResolution-master/VSR/Framework/Trainer.py”, line 103, in _startup self.model.compile() File “/home/david/SAT-FIRE/Codes/Data Fusion/SCRNN with Tensorflow Example/VideoSuperResolution-master/VSR/Framework/SuperResolution.py”, line 84, in compile self.build_graph() File “/home/david/SAT-FIRE/Codes/Data Fusion/SCRNN with Tensorflow Example/VideoSuperResolution-master/VSR/Models/Srcnn.py”, line 43, in build_graph super(SRCNN, self).build_graph() File “/home/david/SAT-FIRE/Codes/Data Fusion/SCRNN with Tensorflow Example/VideoSuperResolution-master/VSR/Framework/SuperResolution.py”, line 117, in build_graph name=‘input/lr’)) File “/home/david/miniconda/lib/python3.7/site-packages/tensorflow/python/ops/array_ops.py”, line 2077, in placeholder return gen_array_ops.placeholder(dtype=dtype, shape=shape, name=name) File “/home/david/miniconda/lib/python3.7/site-packages/tensorflow/python/ops/gen_array_ops.py”, line 5791, in placeholder “Placeholder”, dtype=dtype, shape=shape, name=name) File “/home/david/miniconda/lib/python3.7/site-packages/tensorflow/python/framework/op_def_library.py”, line 788, in _apply_op_helper op_def=op_def) File “/home/david/miniconda/lib/python3.7/site-packages/tensorflow/python/util/deprecation.py”, line 507, in new_func return func(*args, **kwargs) File “/home/david/miniconda/lib/python3.7/site-packages/tensorflow/python/framework/ops.py”, line 3300, in create_op op_def=op_def) File “/home/david/miniconda/lib/python3.7/site-packages/tensorflow/python/framework/ops.py”, line 1801, in init self._traceback = tf_stack.extract_stack()

InvalidArgumentError (see above for traceback): You must feed a value for placeholder tensor ‘input/lr’ with dtype uint8 and shape [?,?,?,?] [[node input/lr (defined at /home/david/SAT-FIRE/Codes/Data Fusion/SCRNN with Tensorflow Example/VideoSuperResolution-master/VSR/Framework/SuperResolution.py:117) ]]

Any ideas what is causing this problem?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
dtlloydcommented, Apr 27, 2019

Thanks for your replies. You are both correct.

For the complete novices, like me, who are also having this problem, I solved the problem by.

  1. Changing the root directory in datasets.yaml to the folder location where the images (91-image and set14 in the case above) live.
  2. Making sure SRCNN.tar.gz file was downloaded and extracted in the Results folder. If you run prepare_data.py as per the readme, SRCNN.tar.gz may not download, even if you answer yes when asked about it.

Things seem to be running fine for me now.

1reaction
rzumercommented, Apr 25, 2019

Usually it is that the dataset is not found at the expected location, so no image/frame can be loaded.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Your First Deep Learning Project in Python with Keras Step-by ...
The number one question I get asked is: “After I train my model, how can I use it to make predictions on new...
Read more >
Assignment 2: Train Your First Model - #42 by skaur07958
hi guys, I don't know what is the error in my code, I search from google but could not find any solution, kindly...
Read more >
Step 4: Build, Train, and Evaluate Your Model
In this section, we will work towards building, training and evaluating our model. In Step 3, we chose to use either an n-gram...
Read more >
Regression Modelling with TensorFlow Made Easy — Train ...
Regression Modelling with TensorFlow Made Easy — Train Your First Model in 10 Minutes. From data gathering and preparation to model training and ......
Read more >
02 train your first model - Deep Java Library
Now, we can train the model. When training, it is usually organized into epochs where each epoch trains the model on each item...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found