C3D-tensorflow: ValueError:Cannot feed value of shape(10,0)for Tensor u'Placeholder:0'
Thanks for authors’ code.
When I run train_c3d_ucf101.py to train the network, Error shows that
ValueError: Cannot feed value of shape (10,0) for Tensor u ‘Placeholder:0’, which has shape ‘(10,16,112,112,3)’
And this is Traceback

I don’t know how to solve this problem, could you tell me?
About this issue
- Original URL
- State: open
- Created 6 years ago
- Comments: 19
I also had this problem, mainly because of address errors of ‘train.list’ and ‘test.list’ in train_c3d_ucf101.py, so I solved the problem by removing ‘list/’ from the original ‘filename’. filename=‘train.list’-------line215 filename=‘test.list’--------line241
@LiXun95 Let me walk you through one step at a time.
Assuming you have extracted C3D-tensorflow to your Documents directory on a Linux system such us Ubuntu, your full path will become ~/Documents/C3D-tensorflow. Use the Terminal to get to this directory
Now in the C3D-tensorflow folder at ~/Documents/C3D-tensorflow copy and paste the UCF101 folder here so that you get ~/Documents/C3D-tensorflow/UCF101.
Navigate to ~/Documents/C3D-tensorflow/list. It has bash files that will not run if you are not logged in as root or using sudo. To overcome this, got to ~/Documents/C3D-tensorflow/list on the terminal and type
chmod +x *.sh.Open the file ~/Documents/C3D-tensorflow/list/convert_video_to_images.sh" with any text editor. You will notice this expression (
**if (( $(jot -r 1 1 $2) > 1 )); then**) on line 31 or so . This piece of code will not run properly unless you have jot installed and this is for Linux only, well as far as I know, so I stand to be corrected. To install jot, in your terminal, type sudo apt-get install athena-jot. You can read more about it here. http://www.unixcl.com/2007/12/jot-print-sequential-or-random-data.htmlYou are now ready to generate imaged from your videos. In the terminal, still in the list directory as ~/Documents/C3D-tensorflow/list, type ./convert_video_to_images.sh ~/Documents/C3D-tensorflow/UCF101 5. You can find the explanation in the README file.
You are now ready to generate lists from your images. In the terminal, still in the list directory as ~/Documents/C3D-tensorflow/list, type ./convert_images_to_list.sh ~/Documents/C3D-tensorflow/UCF101 4 You can find the explanation in the README file.
Now move out of the list directory into the ~/Documents/C3D-tensorflow and run the train_c3d_ucf101.py file. If you use Python 2 you should not have problems, I guess. However, if you use python 3.5+ you my have to work on the range functions. You will have to convert them to list because in python 3+, ranges are not necessarily converted to list. So you have to do
**list(range(......))**I am trying to have that modification done and submitted as a contribution but I am a little time contained now. However, If you ran into some Issues on python 3, please let us know. I will be glad to share my working code with you.
Be sure to also have crop_mean.npy and sports1m_finetuning_ucf101.model files in the ~/Documents/C3D-tensorflow directory if you choose to use the author’s codes without modification. Cheers!
same problem. Solved. Do the ./convert_images_to_list.sh inside the list folder …