Code Monkey home page Code Monkey logo

Comments (19)

wenyachan avatar wenyachan commented on September 13, 2024 4

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

from c3d-tensorflow.

rocksyne avatar rocksyne commented on September 13, 2024 2

@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.html

  • You 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!

from c3d-tensorflow.

Chao1155 avatar Chao1155 commented on September 13, 2024 1

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

from c3d-tensorflow.

Qing25 avatar Qing25 commented on September 13, 2024

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

from c3d-tensorflow.

lixun95 avatar lixun95 commented on September 13, 2024

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/?

from c3d-tensorflow.

Qing25 avatar Qing25 commented on September 13, 2024

@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. :-)

from c3d-tensorflow.

lixun95 avatar lixun95 commented on September 13, 2024

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 ?

from c3d-tensorflow.

rocksyne avatar rocksyne commented on September 13, 2024

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

There are two files.

  • crop_mean.npy and sports1m_finetuning_ucf101.model

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!

from c3d-tensorflow.

Caroline1994 avatar Caroline1994 commented on September 13, 2024

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?

from c3d-tensorflow.

JulioEndara avatar JulioEndara commented on September 13, 2024

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

  • the replacement that @rocksyne sent to you is to allow the code to work with Python3... Inot sure if you were having that issue too regarding lists()
  • I believe the issue your are having is that your lists are not generated correctly and pointing to the wrong place. Follow the readme instructions on how to generate the lists (train and test). To confirm you have them right cd to where your train program is and do a check from there one of the entries in your list... for example 'ls ./UCF101/UCF-101/Apply...etc etc... do copy paste from your list... my guess is that you wont find the file

from c3d-tensorflow.

Caroline1994 avatar Caroline1994 commented on September 13, 2024

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

from c3d-tensorflow.

JulioEndara avatar JulioEndara commented on September 13, 2024

@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

from c3d-tensorflow.

Caroline1994 avatar Caroline1994 commented on September 13, 2024

@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 [email protected].

from c3d-tensorflow.

Caroline1994 avatar Caroline1994 commented on September 13, 2024

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

from c3d-tensorflow.

JulioEndara avatar JulioEndara commented on September 13, 2024

@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.

from c3d-tensorflow.

Shiny128 avatar Shiny128 commented on September 13, 2024

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 :)

from c3d-tensorflow.

rocksyne avatar rocksyne commented on September 13, 2024

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

from c3d-tensorflow.

Shiny128 avatar Shiny128 commented on September 13, 2024

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

from c3d-tensorflow.

JameesWang avatar JameesWang commented on September 13, 2024

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!

from c3d-tensorflow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.