CyFeng16 / MVIMP

Mixed Video and Image Manipulation Program
GNU General Public License v3.0
71 stars 20 forks source link

DAIN inference_dain.py issues . #21

Closed WindyGhost closed 4 years ago

WindyGhost commented 4 years ago

Hi . I wanted to use dain on colab notebook and i encountered an issue . I followed this link and did it . It went smoothly at first , i downloaded the video and then deleted the video manually and when i tried to do it second time i encountered a problem and it was in inference_dain.py . I did find a way by terminating the notebook and repeat the process of installation but i don't want to .

Current PyTorch version is 1.0.0 ffmpeg -hide_banner -loglevel warning -threads 4 -i /content/MVIMP/Data/Input/test.mp4 /content/MVIMP/Data/Input/%8d.png The video-image extracting job is done. Traceback (most recent call last): File "inference_dain.py", line 58, in os.remove(os.path.join(input_data_dir, input_file)) IsADirectoryError: [Errno 21] Is a directory: '/content/MVIMP/Data/Input/.ipynb_checkpoints'

Please respond to my request . Thank you . And this is my first time reporting something in GitHub .

Zotikus1001 commented 4 years ago

The issue here is there is an hidden file ".ipynb_checkpoints" inside the Input folder.

I don't know how that file got there, but when it goes to interpolate, it expects to find only .png images inside the input folder.

It happens to me to when I copy all the files from my google drive folder into the input folder.

WindyGhost commented 4 years ago

When this happened , what i did is that i deleted both the input and output folders , created both the folders , uploaded the video and did it again and it happened again . Idk how to prevent it from making that file or if it gets created , how to delete it or change the location of where the frames gets extracted .

WindyGhost commented 4 years ago

I think i fixed it . Before running this code

!python3 inference_dain.py --input_video test.mp4 --time_step 0.5 -hr

I ran this code

!rm -r /content/MVIMP/Data/Input/.ipynb_checkpoints

And it worked ...

And if someone faces the problem when the frames gets interpolated , it will show that same error

IsADirectoryError: [Errno 21] Is a directory: '/content/MVIMP/Data/Output/.ipynb_checkpoints'

Use this code

!rm -r /content/MVIMP/Data/Output/.ipynb_checkpoints

meguerreroa commented 4 years ago

Is it somehow related to the GPU type? I think i got that error when Colab gave me a T4 16Gb or K80 8 Gb gpu. But never when it gave me a P100 16Gb. But I could be wrong. Anyway, I'll try what @WindyGhost proposed.

CyFeng16 commented 4 years ago

I can call an additional check and delete the Jupyter cache file, WIP.

WindyGhost commented 4 years ago

Is it somehow related to the GPU type? I think i got that error when Colab gave me a T4 16Gb or K80 8 Gb gpu. But never when it gave me a P100 16Gb. But I could be wrong.

I did a little research and found out that the hidden file gets created everytime when you save your .ipynb notebook file , it is to revert to the changes you have made like if u did some mistake you undo in your computer by ctrl+z , this is what it is . And It is not related to what GPU you have been assigned .

WindyGhost commented 4 years ago

Long story short , if you are confused then this is what i do .

  1. First i download and install the dependencies which is Step 1

  2. Then i upload the video in /content/MVIMP/Data/Input

  3. Then i do this

!rm -r /content/MVIMP/Data/Input/.ipynb_checkpoints !rm -r /content/MVIMP/Data/Output/.ipynb_checkpoints

  1. And then i do this

!python3 inference_dain.py --input_video whatever.mp4 --time_step 0.5 -hr

And when everything is done , download the final product , i delete the video manually , which is not needed , but i still do it . And if i want to do it again i do it again from step 2 .

WindyGhost commented 4 years ago

The issue is now closed but i have 1 question . What do you pass with -hr , because i passed both 'true' and 'store_true' but i get error . Any suggestions .

CyFeng16 commented 4 years ago

'store_true' and 'store_false' - These are special cases of 'store_const' using for storing the values True and False respectively. In addition, they create default values of False and True respectively. For example:

parser = argparse.ArgumentParser()
parser.add_argument('--foo', action='store_true')
parser.add_argument('--bar', action='store_false')
parser.add_argument('--baz', action='store_false')
parser.parse_args('--foo --bar'.split())
Namespace(bar=False, baz=True, foo=True)

You can also see argparse for details.

WindyGhost commented 4 years ago

I get it now So i only have to use -hr and it stores true and if i don't use -hr it won't work