Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Decode statement throws out error with png image #47

Closed
sharmaprakhar opened this issue Nov 20, 2019 · 4 comments
Closed

Decode statement throws out error with png image #47

sharmaprakhar opened this issue Nov 20, 2019 · 4 comments
Labels
bug Something isn't working
Milestone

Comments

@sharmaprakhar
Copy link

  • SteganoGAN version or git commit:
  • Python version (output of python --version):
  • Pip version (output of pip --version):
  • PyTorch version (output of python -c "import torch; print(torch.__version__)"):
  • Operating System:

Description

Describe what you were trying to get done.

  • Encode and decode a jpg and a png image
    Tell us what happened, what went wrong, and what you expected to happen.
  • encode works fine but decode throws out an error. The dependencies are mentioned within the post

What I Did

  • I made a quick fix to uitls.py in function starting line 34

from :

ints.append(int(''.join([str(bit) for bit in byte]), 2))

To:

ints.append(int(''.join([str(int(bit)) for bit in byte]), 2))

Paste (all) the command(s) you ran and the output.
If there was a crash, please include the traceback here.

Python 3.7.3 (default, Mar 27 2019, 16:54:48) 
[Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy, torch
>>> print("numpy:", numpy.__version__)
numpy: 1.16.4
>>> print("torch:", torch.__version__)
torch: 1.2.0
>>> 

@csala
Copy link
Contributor

csala commented Nov 21, 2019

Hello @sharmaprakhar

Thanks for reporting this and for the suggested changes. Unfortunately, it is not clear from your description what the actual error is.

Would you mind editing the issue and adding to the "What I did" section the exact commands that you executed and the outputs that you obtained, including the error traceback?

@csala csala added the bug Something isn't working label Nov 21, 2019
@guidefreitas
Copy link

guidefreitas commented Dec 11, 2019

Hello, got an error too when decoding an png image. Details:

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

-v (verbose) didn't add any additional info.

@pvk-developer
Copy link
Member

Hello, got an error too when decoding an png image. Details:

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

-v (verbose) didn't add any additional info.

Hello @guidefreitas, I have faced this problem recently. Would you mind checking out the torch version?
SteganoGAN must use is the 1.0.0 and I have faced the problem with higher torch versions. We will make a new release shortly in order to limit the torch version (as it's already in master).

@pvk-developer
Copy link
Member

I'm closing this issue as we capped outside libraries, see #54 and #50 , that fixes those kind of issues.

@pvk-developer pvk-developer added this to the 0.1.3 milestone Apr 30, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants