Endilll / vapoursynth-preview

Preview for VapourSynth scripts
Apache License 2.0
69 stars 21 forks source link

torch / vsgan incompatibitly on Windows with vs-preview #16

Closed Ichunjo closed 3 years ago

Ichunjo commented 3 years ago

By importing only torch on the script (thus vsgan too) an error is raising when trying to run vapoursynth-preview.

vsedit doesn’t have any issues with torch though.

G:\enco>run script.py
2021-03-13 16:11:45.161: DEBUG: Reading QSS file in: :qdarkstyle\style.qss
2021-03-13 16:11:45.162: INFO: QSS file sucessfuly loaded.
2021-03-13 16:11:45.162: DEBUG: Checking patches for being applied.
2021-03-13 16:11:45.163: INFO: Found application patches to be applied.
2021-03-13 16:11:45.311: ERROR: Script contains error(s). Check following lines for details.
Traceback (most recent call last):
  File "C:\Users\Varde\AppData\Roaming\Python\Python38\Scripts\vapoursynth-preview\vspreview\main.py", line 496, in load_script
    exec(self.script_path.read_text(encoding='utf-8'), {
  File "<string>", line 25, in <module>
  File "C:\Users\Varde\AppData\Roaming\Python\Python38\site-packages\torch\__init__.py", line 116, in <module>
    raise err
OSError: [WinError 127] The specified procedure could not be found. Error loading "C:\Users\Varde\AppData\Roaming\Python\Python38\site-packages\torch\lib\caffe2_detectron_ops_gpu.dll" or one of its dependencies. 
Endilll commented 3 years ago

Are pip install torch command and import torch statement enough to reproduce it?

Ichunjo commented 3 years ago

I'm not sure, to be honest. I should have mentioned that I installed also CUDA and torch 1.6.0+cu101 and I wouldn't be surprised if CUDA messes up like it usually does

Anyway this simple script is enough to raise the error for me:

import vapoursynth as vs
import torch

core = vs.core

clip = core.std.BlankClip()

clip.set_output(0)
Endilll commented 3 years ago

Googling "winerror 127" unexpectedly brought this and this. Also taking nature of the error into account, I expect that VSEdit or VSScript underneath ignores the error somehow.

Ichunjo commented 3 years ago

I finally got my hands on a 3070 and the error is gone. Probably CUDA being CUDA