divelab / dtn

58 stars 19 forks source link

Issue Running the first command #1

Closed ronaldgao closed 6 years ago

ronaldgao commented 7 years ago

Hi:

I first configure the data directory to the current directory. After, I run 'python main.py' but I get the Error:

ValueError: Cannot feed value of shape (10, 256, 256, 3) for Tensor 'annotations:0', which has shape '(10, 256, 256)'

Here is the entire output:

2017-08-10 16:37:37.500262: W c:\tf_jenkins\home\workspace\release-win\m\windows-gpu\py\36\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE instructions, but these are available on your machine and could speed up CPU computations. 2017-08-10 16:37:37.504957: W c:\tf_jenkins\home\workspace\release-win\m\windows-gpu\py\36\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE2 instructions, but these are available on your machine and could speed up CPU computations. 2017-08-10 16:37:37.509978: W c:\tf_jenkins\home\workspace\release-win\m\windows-gpu\py\36\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE3 instructions, but these are available on your machine and could speed up CPU computations. 2017-08-10 16:37:37.514591: W c:\tf_jenkins\home\workspace\release-win\m\windows-gpu\py\36\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations. 2017-08-10 16:37:37.520089: W c:\tf_jenkins\home\workspace\release-win\m\windows-gpu\py\36\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations. 2017-08-10 16:37:37.525476: W c:\tf_jenkins\home\workspace\release-win\m\windows-gpu\py\36\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations. 2017-08-10 16:37:37.531705: W c:\tf_jenkins\home\workspace\release-win\m\windows-gpu\py\36\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations. 2017-08-10 16:37:37.536906: W c:\tf_jenkins\home\workspace\release-win\m\windows-gpu\py\36\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations. 2017-08-10 16:37:37.779525: E c:\tf_jenkins\home\workspace\release-win\m\windows-gpu\py\36\tensorflow\stream_executor\cuda\cuda_driver.cc:406] failed call to cuInit: CUDA_ERROR_NO_DEVICE 2017-08-10 16:37:37.784791: I c:\tf_jenkins\home\workspace\release-win\m\windows-gpu\py\36\tensorflow\stream_executor\cuda\cuda_diagnostics.cc:158] retrieving CUDA diagnostic information for host: Luna 2017-08-10 16:37:37.788163: I c:\tf_jenkins\home\workspace\release-win\m\windows-gpu\py\36\tensorflow\stream_executor\cuda\cuda_diagnostics.cc:165] hostname: Luna down 0 shape (10, 128, 128, 64) down 1 shape (10, 64, 64, 128) down 2 shape (10, 32, 32, 256) down 3 shape (10, 16, 16, 512) bottom shape (10, 16, 16, 512) up 3 shape (10, 32, 32, 256) up 2 shape (10, 64, 64, 128) up 1 shape (10, 128, 128, 64) up 0 shape (10, 256, 256, 21) Traceback (most recent call last): File "main.py", line 111, in tf.app.run() File "C:\Users\Ronald Gao\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\platform\app.py", line 48, in run _sys.exit(main(_sys.argv[:1] + flags_passthrough)) File "main.py", line 105, in main train() File "main.py", line 58, in train model.train() File "D:\Users\Ronald Gao\Documents\dtn\network.py", line 184, in train [self.loss_op, self.valid_summary], feed_dict=feed_dict) File "C:\Users\Ronald Gao\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\client\session.py", line 789, in run run_metadata_ptr) File "C:\Users\Ronald Gao\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\client\session.py", line 975, in _run % (np_val.shape, subfeed_t.name, str(subfeed_t.get_shape()))) ValueError: Cannot feed value of shape (10, 256, 256, 3) for Tensor 'annotations:0', which has shape '(10, 256, 256)'

davehiem commented 7 years ago

When inspecting: train_reader = H5DataLoader(self.conf.data_dir+self.conf.train_data) valid_reader = H5DataLoader(self.conf.data_dir+self.conf.valid_data) train_reader has a tuple of numpy arrays the first with shape (10, 256, 256, 3) (the input shape) and the second with shape (10, 256, 256) (the annotation shape). However, valid_reader has tuples of numpy arrays both with shapes (10, 256, 256, 3). That leads me to think the issue is with validation.h5. When running this with flags.DEFINE_string('valid_data', 'training.h5', 'Validation data') it works.

YongjunChen93 commented 6 years ago

Just update the sample validation dataset and fixed the issue.