This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Deoldify Vapoursynth filter
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
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply
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
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply
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/blo...in.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
Reply
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 Sad
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

Smile Now DeOldify works. Smile
But BasicVSR++ does not. Sad

Cu Selur
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply
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 Smile 

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.  Angel

Dan


Attached Files
.zip   spatial_correlation_sampler-0.5.0-py312-cp312-win_amd64_torch-2.6.0.dev20241101+cu124.whl.zip (Size: 126,34 KB / Downloads: 19)
Reply
Yeah, seems to work. Smile
Nice => releasing a new dev&torch addon once I packaged the whole thing. Smile

Cu Selur
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply
My first impression is the Hybrid R70 with torch 2.6 is about 15% slower than Hybrid R68 with torch 2.5.

Dan
Reply
Haven't noticed anything like that, but I read before that depending on the card and drivers speeds can change.
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply
Hello Selur,

  I noted that you removed the flag "Reference Frames only".

  [Image: attachment.php?aid=2824]

  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


Attached Files Thumbnail(s)
   
Reply
Too groggy today, will look at it tomorrow.
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)