facebookresearch / VMZ

VMZ: Model Zoo for Video Modeling
Apache License 2.0
1.04k stars 156 forks source link

TypeError: '/home/data/initial_training/training/clip1.avi' has type str, but expected one of: bytes #90

Closed ThatIndianCoder closed 4 years ago

ThatIndianCoder commented 4 years ago

I am working on fine-tuning the model for my own dataset. I installed all the dependency packages and the model works fine when I set use_list=0 (in create_video_db.py) and use_local_file=0(in train_net.py)

I would like to load the videos directly from my local machine and Hence I would like to run create_video_db.py with "use_list=1". When I run the data/create_video_db.py with "--use_list=1", I get the above mentioned error. The traceback is as follows:

Traceback (most recent call last): File "data/create_video_db.py", line 152, in main() File "data/create_video_db.py", line 146, in main args.num_epochs File "data/create_video_db.py", line 89, in create_video_db video_tensor.string_data.append(video_data) TypeError: '/home/data/initial_training/training/clip1.avi' has type str, but expected one of: bytes

I created the list file for my dataset by referring to the given list files in the repo, with columns "org_video" and "label". Could anyone explain what is causing this error and how can I fix this?

Thanks in advance.

dutran commented 4 years ago

This is more like python version warning, are you using python 3.0? The script was not tested with Python 3 yet, should be an easy fix though.

ThatIndianCoder commented 4 years ago

Yes. I am using Python 3.7. I will look into it and post the findings here. Thank you.

ThatIndianCoder commented 4 years ago

The issue can be solved by converting the variable "file_name" in create_video_db.py from str to byes.

file_name = file_name.encode('utf-8)

will resolve this error.