RE: Deoldify Vapoursynth filter - Selur - 10.11.2024
Using that version I still get:
Script evaluation failed:
Python exception: Weights only load failed. This file can still be loaded, to do so you have two options, do those steps only if you trust the source of the checkpoint.
(1) Re-running `torch.load` with `weights_only` set to `False` will likely succeed, but it can result in arbitrary code execution. Do it only if you got the file from a trusted source.
(2) Alternatively, to load with `weights_only=True` please check the recommended steps in the following error message.
WeightsUnpickler error: Unsupported global: GLOBAL functools.partial was not an allowed global by default. Please use `torch.serialization.add_safe_globals([partial])` or the `torch.serialization.safe_globals([partial])` context manager to allowlist this global if you trust this class/function.
Check the documentation of torch.load to learn more about types accepted by default with weights_only https://pytorch.org/docs/stable/generated/torch.load.html.
Traceback (most recent call last):
File "src\\cython\\vapoursynth.pyx", line 3387, in vapoursynth._vpy_evaluate
File "src\\cython\\vapoursynth.pyx", line 3388, in vapoursynth._vpy_evaluate
File "j:\tmp\test.vpy", line 44, in <module>
clip = HAVC_main(clip=clip, EnableDeepEx=True, DeepExMethod=0, DeepExRefMerge=0, ScFrameDir=None, DeepExModel=0, DeepExEncMode=0, DeepExMaxMemFrames=0)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\Hybrid\64bit\Vapoursynth\Lib\site-packages\vsdeoldify\__init__.py", line 310, in HAVC_main
clip_ref = HAVC_ddeoldify(clip, method=2, mweight=ddcolor_weight[w_id],
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\Hybrid\64bit\Vapoursynth\Lib\site-packages\vsdeoldify\__init__.py", line 824, in HAVC_ddeoldify
clipa = vs_sc_deoldify(clip, method=method, model=deoldify_model, render_factor=deoldify_rf,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\Hybrid\64bit\Vapoursynth\Lib\site-packages\vsdeoldify\vsslib\vsmodels.py", line 143, in vs_sc_deoldify
colorizer = m_cfg.get_image_colorizer(artistic=False, isvideo=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\Hybrid\64bit\Vapoursynth\Lib\site-packages\vsdeoldify\deoldify\visualize.py", line 76, in get_image_colorizer
return self._get_stable_video_colorizer(render_factor=render_factor)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\Hybrid\64bit\Vapoursynth\Lib\site-packages\vsdeoldify\deoldify\visualize.py", line 137, in _get_stable_video_colorizer
learn = gen_inference_wide(root_folder=root_folder, weights_name=weights_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\Hybrid\64bit\Vapoursynth\Lib\site-packages\vsdeoldify\deoldify\generators.py", line 19, in gen_inference_wide
learn.load(weights_name)
File "F:\Hybrid\64bit\Vapoursynth\Lib\site-packages\vsdeoldify\fastai\basic_train.py", line 267, in load
if purge: self.purge(clear_opt=ifnone(with_opt, False))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\Hybrid\64bit\Vapoursynth\Lib\site-packages\vsdeoldify\fastai\basic_train.py", line 322, in purge
state = torch.load(tmp_file)
^^^^^^^^^^^^^^^^^^^^
File "F:\Hybrid\64bit\Vapoursynth\Lib\site-packages\torch\serialization.py", line 1444, in load
raise pickle.UnpicklingError(_get_wo_message(str(e))) from None
_pickle.UnpicklingError: Weights only load failed. This file can still be loaded, to do so you have two options, do those steps only if you trust the source of the checkpoint.
(1) Re-running `torch.load` with `weights_only` set to `False` will likely succeed, but it can result in arbitrary code execution. Do it only if you got the file from a trusted source.
(2) Alternatively, to load with `weights_only=True` please check the recommended steps in the following error message.
WeightsUnpickler error: Unsupported global: GLOBAL functools.partial was not an allowed global by default. Please use `torch.serialization.add_safe_globals([partial])` or the `torch.serialization.safe_globals([partial])` context manager to allowlist this global if you trust this class/function.
Check the documentation of torch.load to learn more about types accepted by default with weights_only https://pytorch.org/docs/stable/generated/torch.load.html.
Cu Selur
RE: Deoldify Vapoursynth filter - Selur - 10.11.2024
Quote:But with your version torch-2.6.0.dev20241031+cu124 BasicVSR++ was working ?
It was working with the version that is installed in the torch-download which is torch-2.6.0.dev20241101+cu124
RE: Deoldify Vapoursynth filter - Dan64 - 10.11.2024
I think that pip installed the version from cache.
the row 322 of basic_train.py should be now:
state = torch.load(tmp_file, weights_only=False)
see also: https://github.com/dan64/vs-deoldify/blob/4e71da07e7ffbf03b6992a7cd9da15cbcdb08d54/vsdeoldify/fastai/basic_train.py#L322
while in your error log there is still the old code.
Please check.
I will try to get a working version with your October's build of torch.
Dan
RE: Deoldify Vapoursynth filter - Selur - 10.11.2024
Okay, over here it's:
state = torch.load(tmp_file)
Argh,... using:
python -m pip install -I https://github.com/dan64/vs-deoldify/releases/download/v4.5.0/vsdeoldify-4.5.0-py3-none-any.whl
it didn't just force the download of the whl, but of tons of other stuff and installer and torch 2.5.1
Luckily I have the torch package to go back to.
So deleting the existing Vapoursynth and replacing it with the one from the torch package, then callling:
python -m pip install --pre -U torch torchvision torch_tensorrt --index-url https://download.pytorch.org/whl/nightly/cu124 --extra-index-url https://pypi.nvidia.com
python -m pip install https://github.com/dan64/vs-deoldify/releases/download/v4.5.0/vsdeoldify-4.5.0-py3-none-any.whl
and extracting the spacial sampler stuff.
line 322 now shows:
state = torch.load(tmp_file, weights_only=False)
and torch is now: torch-2.6.0.dev20241109+cu124.dist-info
Now DeOldify works.
But BasicVSR++ does not.
Cu Selur
RE: Deoldify Vapoursynth filter - Dan64 - 10.11.2024
Ok, revert your torch installation to the one available on google drive : VapoursynthR70_torch_2024.11.01.7z
Then delete all the files related to spatial_correlation_sampler-0.5.0 and unzip in the folder .\Hybrid\64bit\Vapoursynth\Lib\site-packages the attached archive.
Then upgrade vs-deoldify
python -m pip install https://github.com/dan64/vs-deoldify/releases/download/v4.5.0/vsdeoldify-4.5.0-py3-none-any.whl
Now all should works
As you can see the last torch build torch-2.6.0.dev20241109+cu124 is breaking the compatibility.
Avoid to upgrade torch till will be available a stable build, but even in this case it is probable that something will be broken.
In any case it is better to avoid this event till it will be really necessary an upgrade.
Dan
RE: Deoldify Vapoursynth filter - Selur - 10.11.2024
Yeah, seems to work.
Nice => releasing a new dev&torch addon once I packaged the whole thing.
Cu Selur
RE: Deoldify Vapoursynth filter - Dan64 - 10.11.2024
My first impression is the Hybrid R70 with torch 2.6 is about 15% slower than Hybrid R68 with torch 2.5.
Dan
RE: Deoldify Vapoursynth filter - Selur - 10.11.2024
Haven't noticed anything like that, but I read before that depending on the card and drivers speeds can change.
RE: Deoldify Vapoursynth filter - Dan64 - 12.11.2024
Hello Selur,
I noted that you removed the flag "Reference Frames only".
I know the reasons for the removal, but this flag is useful for a more advanced colouring process.
I understand that this filter is quite complex to use, this complexity is also due to the fact that Hybrid is suitable mainly for advanced users.
I'm planning to write a Colouring Guide for using HAVC in Hybrid to simplify the usage of this filter and reduce its complexity.
Allowing people with no experience of Vapoursynth and Hybrid to use HAVC.
In order to simplify the usage to people with little knowledge of Vapoursynth it will be very useful if you can introduce again in Hybrid the flag "Reference Frames only".
This flag should be enabled when "Ref FrameDir" is set (not empty).
Thanks,
Dan
RE: Deoldify Vapoursynth filter - Selur - 12.11.2024
Too groggy today, will look at it tomorrow.
|