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

training issue #3

Open
KSJhon opened this issue Dec 18, 2021 · 0 comments
Open

training issue #3

KSJhon opened this issue Dec 18, 2021 · 0 comments

Comments

@KSJhon
Copy link

KSJhon commented Dec 18, 2021

Hi!
I prepared TFRecord according your description, but I cannot train your code.
I am wondering if your code is note the last version, especially in the statement of 'psgan.py': results = sess.run(fetches, options=options, run_metadata=run_metadata)
Here is the error message:
Traceback (most recent call last):
File "/home/mycom/miniconda3/envs/PSGanEnv/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1361, in _do_call
return fn(*args)
File "/home/mycom/miniconda3/envs/PSGanEnv/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1340, in _run_fn
target_list, status, run_metadata)
File "/home/mycom/miniconda3/envs/PSGanEnv/lib/python3.6/site-packages/tensorflow/python/framework/errors_impl.py", line 516, in exit
c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.OutOfRangeError: RandomShuffleQueue '_1_shuffle_batch/random_shuffle_queue' is closed and has insufficient elements (requested 32, current size 0)
[[Node: shuffle_batch = QueueDequeueManyV2[component_types=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/device:CPU:0"](shuffle_batch/random_shuffle_queue, shuffle_batch/n)]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/mycom/miniconda3/envs/PSGanEnv/lib/python3.6/site-packages/tensorflow/python/training/supervisor.py", line 990, in managed_session
yield sess
File "/mnt/document/PanSharpening/PSGan/model/psgan/psgan_org.py", line 362, in main
results = sess.run(fetches, options=options, run_metadata=run_metadata)
File "/home/mycom/miniconda3/envs/PSGanEnv/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 905, in run
run_metadata_ptr)
File "/home/mycom/miniconda3/envs/PSGanEnv/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1137, in _run
feed_dict_tensor, options, run_metadata)
File "/home/mycom/miniconda3/envs/PSGanEnv/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1355, in _do_run
options, run_metadata)
File "/home/mycom/miniconda3/envs/PSGanEnv/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1374, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.OutOfRangeError: RandomShuffleQueue '_1_shuffle_batch/random_shuffle_queue' is closed and has insufficient elements (requested 32, current size 0)
[[Node: shuffle_batch = QueueDequeueManyV2[component_types=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/device:CPU:0"](shuffle_batch/random_shuffle_queue, shuffle_batch/n)]]

Caused by op 'shuffle_batch', defined at:
File "/mnt/document/PanSharpening/PSGan/model/psgan/psgan_org.py", line 401, in
main()
File "/mnt/document/PanSharpening/PSGan/model/psgan/psgan_org.py", line 266, in main
examples = load_examples(a)
File "/mnt/document/PanSharpening/PSGan/utils.py", line 102, in load_examples
batch_size=args.batch_size, capacity=200, min_after_dequeue=100)
File "/home/mycom/miniconda3/envs/PSGanEnv/lib/python3.6/site-packages/tensorflow/python/training/input.py", line 1301, in shuffle_batch
name=name)
File "/home/mycom/miniconda3/envs/PSGanEnv/lib/python3.6/site-packages/tensorflow/python/training/input.py", line 847, in _shuffle_batch
dequeued = queue.dequeue_many(batch_size, name=name)
File "/home/mycom/miniconda3/envs/PSGanEnv/lib/python3.6/site-packages/tensorflow/python/ops/data_flow_ops.py", line 483, in dequeue_many
self._queue_ref, n=n, component_types=self._dtypes, name=name)
File "/home/mycom/miniconda3/envs/PSGanEnv/lib/python3.6/site-packages/tensorflow/python/ops/gen_data_flow_ops.py", line 2430, in _queue_dequeue_many_v2
component_types=component_types, timeout_ms=timeout_ms, name=name)
File "/home/mycom/miniconda3/envs/PSGanEnv/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
File "/home/mycom/miniconda3/envs/PSGanEnv/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3271, in create_op
op_def=op_def)
File "/home/mycom/miniconda3/envs/PSGanEnv/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1650, in init
self._traceback = self._graph._extract_stack() # pylint: disable=protected-access

OutOfRangeError (see above for traceback): RandomShuffleQueue '_1_shuffle_batch/random_shuffle_queue' is closed and has insufficient elements (requested 32, current size 0)
[[Node: shuffle_batch = QueueDequeueManyV2[component_types=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/device:CPU:0"](shuffle_batch/random_shuffle_queue, shuffle_batch/n)]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/mnt/document/PanSharpening/PSGan/model/psgan/psgan_org.py", line 401, in
main()
File "/mnt/document/PanSharpening/PSGan/model/psgan/psgan_org.py", line 398, in main
break
File "/home/mycom/miniconda3/envs/PSGanEnv/lib/python3.6/contextlib.py", line 99, in exit
self.gen.throw(type, value, traceback)
File "/home/mycom/miniconda3/envs/PSGanEnv/lib/python3.6/site-packages/tensorflow/python/training/supervisor.py", line 1000, in managed_session
self.stop(close_summary_writer=close_summary_writer)
File "/home/mycom/miniconda3/envs/PSGanEnv/lib/python3.6/site-packages/tensorflow/python/training/supervisor.py", line 828, in stop
ignore_live_threads=ignore_live_threads)
File "/home/mycom/miniconda3/envs/PSGanEnv/lib/python3.6/site-packages/tensorflow/python/training/coordinator.py", line 389, in join
six.reraise(*self._exc_info_to_raise)
File "/home/mycom/miniconda3/envs/PSGanEnv/lib/python3.6/site-packages/six.py", line 719, in reraise
raise value
File "/home/mycom/miniconda3/envs/PSGanEnv/lib/python3.6/site-packages/tensorflow/python/training/queue_runner_impl.py", line 252, in _run
enqueue_callable()
File "/home/mycom/miniconda3/envs/PSGanEnv/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1259, in _single_operation_run
None)
File "/home/mycom/miniconda3/envs/PSGanEnv/lib/python3.6/site-packages/tensorflow/python/framework/errors_impl.py", line 516, in exit
c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.InvalidArgumentError: Input to reshape is a tensor with 1048576 values, but the requested shape has 524288
[[Node: Reshape_1 = Reshape[T=DT_INT16, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:GPU:0"](DecodeRaw_1/_153, Reshape_1/shape)]]
[[Node: Cast/_157 = _Recvclient_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device_incarnation=1, tensor_name="edge_27_Cast", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:CPU:0"]]

Process finished with exit code 1

Help me, please.

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

1 participant