hx173149 / C3D-tensorflow

C3D is a modified version of BVLC tensorflow to support 3D ConvNets.
MIT License
587 stars 265 forks source link

ValueError:Cannot feed value of shape(10,0)for Tensor u'Placeholder:0' #47

Open lixun95 opened 6 years ago

lixun95 commented 6 years ago

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 277825364

I don't know how to solve this problem, could you tell me?

Qing25 commented 6 years ago

That was because your program didn't read the images correctly.

lixun95 commented 6 years ago

Thank you @Qing25 for your answer, Do you mean my UCF101( has converted to images ) is in the wrong folder? Now my UCF101 is in C3D-tensorflow/list/, Should I move it to C3D-tensorflow/?

rocksyne commented 6 years ago

@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

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!

Qing25 commented 6 years ago

@LiXun95 Well, I suggest you view the image path yourself by opening train.list. It seems that the path is relative to file train_c3d_ucf101.py, cut your UCF101 and paste it to the right folder. Do not be afraid to try. :-)

lixun95 commented 6 years ago

Thank you very much! @rocksyne First time I run this program with python 3.5, as you said, there are two main errors I met:

  1. TypeError: unsupported operand type(s) for +: 'dict_values' and 'dict_values' in line 165 varlist1 = list( set(weights.values() + biases.values()) - set(varlist2) ) and line 197 shows the same error.

  2. TypeError: 'range' object does not support item assignment from File "/home/lixun/anaconda3/lib/python3.5/random.py", line 272, in shuffle x[i], x[j] = x[j], x[i]

Then I realize it need python 2, I install Anaconda 2 and try to run this program. From @Qing25 and your help I think I put UCF101 in a wrong place, I will retry it, thank you all!

As you say: I need sports1m_finetuning_ucf101.model in my C3D directory, Should I downloads and put it in the directory first time I train C3D model ?

rocksyne commented 6 years ago

@LiXun95 To download the sports1m_finetuning_ucf101.model got to https://www.dropbox.com/sh/8wcjrcadx4r31ux/AAAkz3dQ706pPO8ZavrztRCca?dl=0

There are two files.

Download and put both in the C3D-tensorflow extracted folder. You really need these! All two!

To help you rectify the problems, download these files of mine (replacefile.zip) and replace the content in C3D-tensorflow

repalacefile.zip

That should solve your problem. It took me a while to figure this out so I am happy to share with you. Cheers!

Caroline1994 commented 6 years ago

Hi, @rocksyne I have download and replace your repalacefile.zip.But I still got the same problem when I run the train_c3d_ucf101.py default I put my folders like this default and the contents of train.list are as follow default what should I do? @lixun95 Have you solved this problem?

JulioEndara commented 6 years ago

@Caroline1994 I'm starting to look at this repo so may be wrong here but this is what I think regarding your issue:

Caroline1994 commented 6 years ago

Hi, @JulioEndara Could you tell me where to download ./sports1m_finetuning_ucf101.model?

JulioEndara commented 6 years ago

@Caroline1994 it's documented in the readme file... read until the end... it's at the bottom in a table. All the models the author mentions are there. Attached screenshot.

image

Caroline1994 commented 6 years ago

@JulioEndara Thank you very much But I can't open those website,If you download it successfully,could you email it to me?My email address is Caroline_cy1994@163.com.

Caroline1994 commented 6 years ago

@JulioEndara I have download it successfully,Thank you very much!

JulioEndara commented 6 years ago

@Caroline1994 that's odd, they are hosted in drop and baiduyun, should work from anywhere

I cannot email them to you because they are too large for email (~300mb).

I believe this topic has now forked into a different conversation. I suggest you create a new issue.

Chao1155 commented 6 years ago

same problem. Solved. Do the ./convert_images_to_list.sh inside the list folder ...

wenyachan commented 5 years ago

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

Shiny128 commented 5 years ago

Hello, I followed the steps mentioned by @rocksyne , I was able to successfully execute train_C3D_tensorflow.py Thanks a lot But even after 50 iterations , ie 50 steps I'm still getting the accuracy =1.000 @rocksyne Please help me resolve this issue.

Thank You :)

rocksyne commented 5 years ago

@Shiny128 Are you training from scratch or you are transfer learning?

Shiny128 commented 5 years ago

Hi, @rocksyne could you please tell me how I can use this code for feature extraction?

JameesWang commented 4 years ago

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

Thank you ! It really works!