Open mhassan93 opened 3 years ago
Original stack trace for 'model/sr_input_scale':
File "test.py", line 80, in
Oops, sorry for the error. Can you check whether the testing works well when you change this line of the test.py
?:
https://github.com/idearibosome/tf-perceptual-eusr/blob/master/test/test.py#L34
from
model_output = tf.import_graph_def(model_graph_def, name='model', input_map={'sr_input:0': image}, return_elements=['sr_output:0'])[0]
to
model_output = tf.import_graph_def(model_graph_def, name='model', input_map={'sr_input:0': image, 'sr_input_scale:0': 4}, return_elements=['sr_output:0'])[0]
I am currently not available to test it on my side, but I will try to figure it out in a few days.
Thanks for the response. The code does run without an error now but it terminates without writing any images to the target folder. The final print statement also doesn't get executed.
Sorry for the late response. The main problem of the test code is the lack of providing upscaling factor, which is defined as sr_input_scale:0
in the trained model.
I've updated test.py
(via this commit) to support both our pretrained models and models trained via our code. With the new testing code, the frozen graph should be loaded successfully.
I am unable to run test.py successfully. I keep running into this error which I have not been able to figure out. Any help in this regard is highly appreciated. The error is as follows.
Error
Found 356 images
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "test.py", line 83, in
main()
File "test.py", line 77, in main
sess.run([write_op], feed_dict={model_input_path:input_path, model_output_path:output_path})
File "C:\Users\user\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\client\session.py", line 956, in run
run_metadata_ptr)
File "C:\Users\user\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\client\session.py", line 1180, in _run
feed_dict_tensor, options, run_metadata)
File "C:\Users\user\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\client\session.py", line 1359, in _do_run
run_metadata)
File "C:\Users\user\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\client\session.py", line 1384, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: You must feed a value for placeholder tensor 'model/sr_input_scale' with dtype float
[[node model/sr_input_scale (defined at C:\Users\user\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\framework\ops.py:1748) ]]