DAI-Lab / SteganoGAN

SteganoGAN is a tool for creating steganographic images using adversarial training.
MIT License
305 stars 85 forks source link

ERROR: invalid literal for int() with base 2: 'TrueFalseTrueTrueTrueTrueTrueTrue' #70

Open nekomeowww opened 2 years ago

nekomeowww commented 2 years ago

Description

I tried to encode and decode the image secret message, however, it failed to decode the messages, and returned:

ERROR: invalid literal for int() with base 2: 'TrueFalseTrueTrueTrueTrueTrueTrue'

What I Did

Firstly I ran:

steganogan encode --cpu --verbose --output enc.jpeg orig.jpg "123123"

The result is good, the shell responded:

Using CPU device
Encoding completed.

And then I ran:

steganogan decode --cpu --verbose enc.jpeg

The result is failed, the shell responded:

Using CPU device
ERROR: invalid literal for int() with base 2: 'TrueFalseTrueTrueTrueTrueTrueTrue'

And additional, there are some warning messages during these two runs:

/usr/local/lib/python3.7/site-packages/torch/serialization.py:671: 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)
/usr/local/lib/python3.7/site-packages/torch/serialization.py:671: 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)
/usr/local/lib/python3.7/site-packages/torch/serialization.py:671: 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)
/usr/local/lib/python3.7/site-packages/torch/serialization.py:671: 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)
/usr/local/lib/python3.7/site-packages/torch/serialization.py:671: 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)
/usr/local/lib/python3.7/site-packages/torch/serialization.py:671: 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)
nekomeowww commented 2 years ago

I initially tried this python tool on my macOS with pip3 install steganogan, and encountered the same issue: ERROR: invalid literal for int() with base 2.

Then I was wondering if my envirnoment is not capable for this, I tried 0.1.3 with the same image as Docker image python:3.7-bulleye on Docker Desktop of macOS, there is no warning messages during the execution, however, I got an error with:

Using CPU device
ERROR: Failed to find message.

I follow the thread https://github.com/DAI-Lab/SteganoGAN/issues/65 with comment https://github.com/DAI-Lab/SteganoGAN/issues/65#issuecomment-874724964, the person said he tried a 0.1.0 version of steganogan, all the issues gone and disappeared, so I went to try version 0.1.0.

And again, I failed to compile one of the dependencies scikit-learn with following errors:

ERROR: Failed building wheel for scikit-learn
  Running setup.py clean for scikit-learn
  Running command /usr/local/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-vwef8q0e/scikit-learn_f13f6ce501ec42b8a9376648ead182ca/setup.py'"'"'; __file__='"'"'/tmp/pip-install-vwef8q0e/scikit-learn_f13f6ce501ec42b8a9376648ead182ca/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' clean --all

I've tried 0.1.1, same as version 0.1.0.

Is there any helpful documentations or build examples? I can't get any of those working.

leferrad commented 1 year ago

Same error here. Any updates about the reason?

leferrad commented 1 year ago

This can be solved by using the current version in master branch. However, to make it work, dependencies must be upgrades. I submitted #88 to track this work.

bbtx2024 commented 1 week ago

This can be solved by using the current version in master branch. However, to make it work, dependencies must be upgrades. I submitted #88 to track this work.

does that working i meet the same situation.ERROR: invalid literal for int() with base 2: 'TrueFalseTrueTrueTrueTrueTrueTrue'