nerdyrodent / VQGAN-CLIP

Just playing with getting VQGAN+CLIP running locally, rather than having to use colab.
Other
2.59k stars 427 forks source link

I keep getting a traceback trying to make a video #51

Closed constantupgrade closed 2 years ago

constantupgrade commented 2 years ago

in line 988 "AttributeError: 'int' object has no attribute 'stdin'"

ffmpeg command failed - check your installation 0%| | 0/5 [00:00<?, ?it/s] Traceback (most recent call last): File "C:\Users\Caleb\VQGAN-CLIP\generate.py", line 988, in im.save(p.stdin, 'PNG') AttributeError: 'int' object has no attribute 'stdin'

Maybe i'm trying to make a video wrong, but the issue persists even with the provided example of the telephone box.

SnortingPixels commented 2 years ago

install ffmpeg ?

Sebocto commented 2 years ago

I am having the same issue and I have made sure ffmpeg is installed

somecoulombs commented 2 years ago

I had this same issue, and I had to put ffmpeg.exe in the same directory as generate.py

Ouroboratika commented 2 years ago

+1 to this issue

Edit: I'm investigating how to get ffmpeg available as a CLI command (since that seems to be how the Popen() function on line 943 is running it). I had tried a plain pip install ffmpeg-python but that seems to just make it available for working with within a Python script.

Edit 2: Got it! I went to https://ffmpeg.org/download.html#build-windows and downloaded a compiled binary from one of the sites it linked to (or, if you know how, you could just download the source and compile it.). I unzipped the folder, renamed it to ffmpeg for clarity and moved it into my C:\Program Files\ directory, then added C:\Program Files\ffmpeg\bin to my PATH environment variable. I logged out and logged back in to get the updated PATH to register and re-ran the script, and it generated the .mp4 successfully.

tl;dr: Have the ffmpeg executable in your PATH.

republicofcongo commented 2 years ago

@Ouroboratika >then added C:\Program Files\ffmpeg\bin to my PATH environment variable.

Sorry I'm super new to this. How do I update that PATH variable? I'm in Anaconda viewer and it won't let me update.

Ouroboratika commented 2 years ago

@Ouroboratika >then added C:\Program Files\ffmpeg\bin to my PATH environment variable.

Sorry I'm super new to this. How do I update that PATH variable? I'm in Anaconda viewer and it won't let me update.

@republicofcongo Oh sure thing. I'm sure there's a way to do it in PowerShell but I'd have to look up the syntax. The GUI-driven way I did it is (assuming you're on Windows 10):

Hope that helps!