rizkiarm / LipNet

Keras implementation of 'LipNet: End-to-End Sentence-level Lipreading'
MIT License
635 stars 226 forks source link

Print parentheses error #33

Closed sf308 closed 6 years ago

sf308 commented 6 years ago

I'm running the training script for overlapped speakers s1 and I keep getting this error:

C:\Users\SFeng\Miniconda2\envs\py3k\LipNet>python training\overlapped_speakers\train.py s1 Using TensorFlow backend. Traceback (most recent call last): File "training\overlapped_speakers\train.py", line 3, in from lipnet.lipreading.generators import BasicGenerator File "c:\users\sfeng\miniconda2\envs\py3k\lipnet\lipnet\lipreading\generators.py", line 93 print "Error loading video: "+video_path ^ SyntaxError: Missing parentheses in call to 'print'

How do I resolve this?

Yuren-Zhong commented 6 years ago

I suppose that you installed python3, but this repo is originally developed with python2.

In python2, print "hello" and print("hello") are both correct; but in python3, only print("hello") is allowed.

You may 1) change all print "..." into print("...") or 2) re-install python2.

I recommend the second solution.

sf308 commented 6 years ago

I've done that and out now I end up with another problem. I think there is a problem with the way I am specifying file paths.:

C:\Users\Souheil\Miniconda2\envs\py3k\LipNet>python training\overlapped_speakers\train.py s1 Using TensorFlow backend. Traceback (most recent call last): File "training\overlapped_speakers\train.py", line 3, in from lipnet.lipreading.generators import BasicGenerator File "c:\users\souheil\miniconda2\envs\py3k\lipnet\lipnet\lipreading\generators.py", line 96 print "Video "+video_path+" has incorrect shape "+str(video.data.shape)+", must be "+str((self.img_c,self.frames_n,self.img_w,self.img_h))+"" ^ SyntaxError: invalid syntax

Yuren-Zhong commented 6 years ago

@sf308 You'd better use python2

sf308 commented 6 years ago

I would use Python 2 but I am unable to install a compatible version of tensorflow.

Yuren-Zhong commented 6 years ago

try Anaconda

sf308 commented 6 years ago

I am currently working from an Anaconda 3.6 environment but may switch to Anaconda 2.7. I think the problem may be that I may have missed out the training step. Thank you for your assistance by the way.

I tried running the training step in the form of python prepare.py [Path to video dataset] [Path to align dataset] [Number of samples]. Below is code I ran(screenshot below): lipnet

These are the parameter I used in my code: [Path to video dataset] - C:\Users\SFeng\Miniconda2\envs\py3k\LipNet\training\overlapped_speakers\datasets\video [Path to align dataset] - C:\Users\SFeng\Miniconda2\envs\py3k\LipNet\training\overlapped_speakers\datasets\align [Number of samples] - 3

I have been using datasets s1, s2 and s3 and below are screenshots of what my align and video directories look like: align video

Is there any problem with the way I have set up my directories?

sf308 commented 6 years ago

Problem solved- switched to Ubuntu