Open kompowiec opened 1 week ago
i ask gpt how to deal with it. gpt told me to use docker and i create a docker with python3.6 and encode successful. now i cant decode
I also used chatgpt but they just suggested weights_only=False)
and i create a docker with python3.6 and encode successful.
now it's makes sense. I had no idea what version of python it required. As for torch, I'll probably have to manually download it from another source.
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
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'
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 settorch.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 settorch.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 settorch.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 settorch.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 settorch.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, inWhat 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
I don't know what else I can do. Model training works for me.