You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/home/kompowiec2/myenv/lib/python3.12/site-packages/torch/serialization.py:1113: SourceChangeWarning: source code of class 'torch.nn.modules.container.Sequential' has changed. you can retrieve the original source code by accessing the object's source attribute or set torch.nn.Module.dump_patches = True and use the patch tool to revert the changes.
warnings.warn(msg, SourceChangeWarning)
/home/kompowiec2/myenv/lib/python3.12/site-packages/torch/serialization.py:1113: SourceChangeWarning: source code of class 'torch.nn.modules.conv.Conv2d' has changed. you can retrieve the original source code by accessing the object's source attribute or set torch.nn.Module.dump_patches = True and use the patch tool to revert the changes.
warnings.warn(msg, SourceChangeWarning)
/home/kompowiec2/myenv/lib/python3.12/site-packages/torch/serialization.py:1113: SourceChangeWarning: source code of class 'torch.nn.modules.activation.LeakyReLU' has changed. you can retrieve the original source code by accessing the object's source attribute or set torch.nn.Module.dump_patches = True and use the patch tool to revert the changes.
warnings.warn(msg, SourceChangeWarning)
/home/kompowiec2/myenv/lib/python3.12/site-packages/torch/serialization.py:1113: SourceChangeWarning: source code of class 'torch.nn.modules.batchnorm.BatchNorm2d' has changed. you can retrieve the original source code by accessing the object's source attribute or set torch.nn.Module.dump_patches = True and use the patch tool to revert the changes.
warnings.warn(msg, SourceChangeWarning)
/home/kompowiec2/myenv/lib/python3.12/site-packages/torch/serialization.py:1113: SourceChangeWarning: source code of class 'steganogan.decoders.DenseDecoder' has changed. you can retrieve the original source code by accessing the object's source attribute or set torch.nn.Module.dump_patches = True and use the patch tool to revert the changes.
warnings.warn(msg, SourceChangeWarning)
/home/kompowiec2/myenv/lib/python3.12/site-packages/torch/serialization.py:1113: SourceChangeWarning: source code of class 'steganogan.critics.BasicCritic' has changed. you can retrieve the original source code by accessing the object's source attribute or set torch.nn.Module.dump_patches = True and use the patch tool to revert the changes.
warnings.warn(msg, SourceChangeWarning)
Traceback (most recent call last):
File "/home/kompowiec2/myenv/bin/steganogan", line 8, in
sys.exit(main())
^^^^^^
File "/home/kompowiec2/myenv/lib/python3.12/site-packages/steganogan/cli.py", line 88, in main
args.action(args)
File "/home/kompowiec2/myenv/lib/python3.12/site-packages/steganogan/cli.py", line 25, in _encode
steganogan = _get_steganogan(args)
^^^^^^^^^^^^^^^^^^^^^
File "/home/kompowiec2/myenv/lib/python3.12/site-packages/steganogan/cli.py", line 20, in _get_steganogan
return SteganoGAN.load(**steganogan_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/kompowiec2/myenv/lib/python3.12/site-packages/steganogan/models.py", line 364, in load
steganogan = torch.load(path, map_location='cpu', weights_only=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/kompowiec2/myenv/lib/python3.12/site-packages/torch/serialization.py", line 1040, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/kompowiec2/myenv/lib/python3.12/site-packages/torch/serialization.py", line 1272, in _legacy_load
result = unpickler.load()
^^^^^^^^^^^^^^^^
File "/home/kompowiec2/myenv/lib/python3.12/site-packages/torch/optim/adam.py", line 66, in setstate
super().setstate(state)
File "/home/kompowiec2/myenv/lib/python3.12/site-packages/torch/optim/optimizer.py", line 313, in setstate
self.defaults.setdefault('differentiable', False)
^^^^^^^^^^^^^
AttributeError: 'Adam' object has no attribute 'defaults'
ERROR: Could not find a version that satisfies the requirement torch==1.8.1 (from versions: 2.2.0, 2.2.1, 2.2.2, 2.3.0, 2.3.1, 2.4.0, 2.4.1, 2.5.0, 2.5.1)
[notice] A new release of pip is available: 24.2 -> 24.3.1
[notice] To update, run: pip install --upgrade pip
ERROR: No matching distribution found for torch==1.8.1
Traceback (most recent call last):
File "/home/kompowiec2/myenv/bin/steganogan", line 8, in
sys.exit(main())
^^^^^^
File "/home/kompowiec2/myenv/lib/python3.12/site-packages/steganogan/cli.py", line 88, in main
args.action(args)
File "/home/kompowiec2/myenv/lib/python3.12/site-packages/steganogan/cli.py", line 25, in _encode
steganogan = _get_steganogan(args)
^^^^^^^^^^^^^^^^^^^^^
File "/home/kompowiec2/myenv/lib/python3.12/site-packages/steganogan/cli.py", line 20, in _get_steganogan
return SteganoGAN.load(**steganogan_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/kompowiec2/myenv/lib/python3.12/site-packages/steganogan/models.py", line 364, in load
steganogan = torch.load(path, map_location='cpu', weights_only=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/kompowiec2/myenv/lib/python3.12/site-packages/torch/serialization.py", line 1383, 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 steganogan.models.SteganoGAN was not an allowed global by default. Please use torch.serialization.add_safe_globals([SteganoGAN]) to allowlist this global if you trust this class/function.
I don't know what else I can do. Model training works for me.
The text was updated successfully, but these errors were encountered:
python --version
): Python 3.12.7pip --version
): pip 24.3.1 from /usr/lib/python3.12/site-packages/pip (python 3.12)python -c "import torch; print(torch.__version__)"
): 2.3.1Description
steganogan encode -v in.png "Hello world" -o out.png
/home/kompowiec2/myenv/lib/python3.12/site-packages/torch/serialization.py:1113: SourceChangeWarning: source code of class 'torch.nn.modules.container.Sequential' has changed. you can retrieve the original source code by accessing the object's source attribute or set
torch.nn.Module.dump_patches = True
and use the patch tool to revert the changes.warnings.warn(msg, SourceChangeWarning)
/home/kompowiec2/myenv/lib/python3.12/site-packages/torch/serialization.py:1113: SourceChangeWarning: source code of class 'torch.nn.modules.conv.Conv2d' has changed. you can retrieve the original source code by accessing the object's source attribute or set
torch.nn.Module.dump_patches = True
and use the patch tool to revert the changes.warnings.warn(msg, SourceChangeWarning)
/home/kompowiec2/myenv/lib/python3.12/site-packages/torch/serialization.py:1113: SourceChangeWarning: source code of class 'torch.nn.modules.activation.LeakyReLU' has changed. you can retrieve the original source code by accessing the object's source attribute or set
torch.nn.Module.dump_patches = True
and use the patch tool to revert the changes.warnings.warn(msg, SourceChangeWarning)
/home/kompowiec2/myenv/lib/python3.12/site-packages/torch/serialization.py:1113: SourceChangeWarning: source code of class 'torch.nn.modules.batchnorm.BatchNorm2d' has changed. you can retrieve the original source code by accessing the object's source attribute or set
torch.nn.Module.dump_patches = True
and use the patch tool to revert the changes.warnings.warn(msg, SourceChangeWarning)
/home/kompowiec2/myenv/lib/python3.12/site-packages/torch/serialization.py:1113: SourceChangeWarning: source code of class 'steganogan.decoders.DenseDecoder' has changed. you can retrieve the original source code by accessing the object's source attribute or set
torch.nn.Module.dump_patches = True
and use the patch tool to revert the changes.warnings.warn(msg, SourceChangeWarning)
/home/kompowiec2/myenv/lib/python3.12/site-packages/torch/serialization.py:1113: SourceChangeWarning: source code of class 'steganogan.critics.BasicCritic' has changed. you can retrieve the original source code by accessing the object's source attribute or set
torch.nn.Module.dump_patches = True
and use the patch tool to revert the changes.warnings.warn(msg, SourceChangeWarning)
Traceback (most recent call last):
File "/home/kompowiec2/myenv/bin/steganogan", line 8, in
sys.exit(main())
^^^^^^
File "/home/kompowiec2/myenv/lib/python3.12/site-packages/steganogan/cli.py", line 88, in main
args.action(args)
File "/home/kompowiec2/myenv/lib/python3.12/site-packages/steganogan/cli.py", line 25, in _encode
steganogan = _get_steganogan(args)
^^^^^^^^^^^^^^^^^^^^^
File "/home/kompowiec2/myenv/lib/python3.12/site-packages/steganogan/cli.py", line 20, in _get_steganogan
return SteganoGAN.load(**steganogan_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/kompowiec2/myenv/lib/python3.12/site-packages/steganogan/models.py", line 364, in load
steganogan = torch.load(path, map_location='cpu', weights_only=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/kompowiec2/myenv/lib/python3.12/site-packages/torch/serialization.py", line 1040, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/kompowiec2/myenv/lib/python3.12/site-packages/torch/serialization.py", line 1272, in _legacy_load
result = unpickler.load()
^^^^^^^^^^^^^^^^
File "/home/kompowiec2/myenv/lib/python3.12/site-packages/torch/optim/adam.py", line 66, in setstate
super().setstate(state)
File "/home/kompowiec2/myenv/lib/python3.12/site-packages/torch/optim/optimizer.py", line 313, in setstate
self.defaults.setdefault('differentiable', False)
^^^^^^^^^^^^^
AttributeError: 'Adam' object has no attribute 'defaults'
What I Did
i modify steganogan/models.py:
steganogan = torch.load(path, map_location='cpu', weights_only=False)
ERROR: Could not find a version that satisfies the requirement torch==1.8.1 (from versions: 2.2.0, 2.2.1, 2.2.2, 2.3.0, 2.3.1, 2.4.0, 2.4.1, 2.5.0, 2.5.1)
[notice] A new release of pip is available: 24.2 -> 24.3.1
[notice] To update, run: pip install --upgrade pip
ERROR: No matching distribution found for torch==1.8.1
File "/home/kompowiec2/myenv/bin/steganogan", line 8, in
sys.exit(main())
^^^^^^
File "/home/kompowiec2/myenv/lib/python3.12/site-packages/steganogan/cli.py", line 88, in main
args.action(args)
File "/home/kompowiec2/myenv/lib/python3.12/site-packages/steganogan/cli.py", line 25, in _encode
steganogan = _get_steganogan(args)
^^^^^^^^^^^^^^^^^^^^^
File "/home/kompowiec2/myenv/lib/python3.12/site-packages/steganogan/cli.py", line 20, in _get_steganogan
return SteganoGAN.load(**steganogan_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/kompowiec2/myenv/lib/python3.12/site-packages/steganogan/models.py", line 364, in load
steganogan = torch.load(path, map_location='cpu', weights_only=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/kompowiec2/myenv/lib/python3.12/site-packages/torch/serialization.py", line 1383, 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 steganogan.models.SteganoGAN was not an allowed global by default. Please use torch.serialization.add_safe_globals([SteganoGAN]) to allowlist this global if you trust this class/function.
I don't know what else I can do. Model training works for me.
The text was updated successfully, but these errors were encountered: