Giter VIP home page Giter VIP logo

Comments (18)

gslxr avatar gslxr commented on June 1, 2024 1

no,though it is empty,it also can use without error.

from stegastamp.

tancik avatar tancik commented on June 1, 2024

I am a bit confused by your questions.
When you run bash scripts/base.sh EXP_NAME does it not save out the model?

from stegastamp.

gslxr avatar gslxr commented on June 1, 2024

from stegastamp.

edwardocano avatar edwardocano commented on June 1, 2024

Hi gslxr, i have the same proble. Did you solved it?

from stegastamp.

tancik avatar tancik commented on June 1, 2024

At the end of the training the model is saved here -

tf.saved_model.simple_save(session,

Can you verify this line is run without error, if not, what is the error? Perhaps there is permission issues with your folders?

from stegastamp.

edwardocano avatar edwardocano commented on June 1, 2024

Yes, that line runs without problem. the problem is that my saved_model.pb has a size of 215.5 MB and your saved_model.pb is 241.8kb. Also my variables folder is empty. and your traned model has two files of 217 MB and 2.4kb.

from stegastamp.

tancik avatar tancik commented on June 1, 2024

Ahh, gotcha. What happens when you try to run your saved model? What error do you get?

from stegastamp.

edwardocano avatar edwardocano commented on June 1, 2024

I got this
https://drive.google.com/file/d/1hHtizPeY8f4Spfkuahb8X2xZl_mt9-dy/view?usp=sharing this is the link of my trained model. I just change the size of the data to 50 bits.

Traceback (most recent call last): File "encode_image.py", line 93, in <module> main() File "encode_image.py", line 76, in main hidden_img, residual = sess.run([output_stegastamp, output_residual],feed_dict=feed_dict) File "/home/ed/Desktop/StegaStamp/virtualenv/lib/python3.7/site-packages/tensorflow_core/python/client/session.py", line 956, in run run_metadata_ptr) File "/home/ed/Desktop/StegaStamp/virtualenv/lib/python3.7/site-packages/tensorflow_core/python/client/session.py", line 1156, in _run (np_val.shape, subfeed_t.name, str(subfeed_t.get_shape()))) ValueError: Cannot feed value of shape (1, 100) for Tensor 'input_prep:0', which has shape '(?, 50)'

from stegastamp.

tancik avatar tancik commented on June 1, 2024

You are getting a shape error
Cannot feed value of shape (1, 100) for Tensor 'input_prep:0', which has shape '(?, 50)'
This isn't caused by the saved model issue you mentioned above. You need to pass your secret size as an argument to encode image.

parser.add_argument('--secret_size', type=int, default=100)

from stegastamp.

edwardocano avatar edwardocano commented on June 1, 2024

Yes! i understand that part.
python encode_image.py saved_models2/stegastamp_pretrained --image original.jpg --save_dir out/ --secret 12 --secret_size 50
This is the line i use. even if i write --secret_size 50 with your trained model. it does not show any error. where is the secret_size value used?

from stegastamp.

tancik avatar tancik commented on June 1, 2024

Ahh, yes that is an error on my part. Then encode_image.py requires the code to be of length 100. This function uses BCH codes with specific parameters to convert a string into a 100bit message. You must use a different error correcting code (or no error correcting) if you change the size of the message.

from stegastamp.

edwardocano avatar edwardocano commented on June 1, 2024

Could you share a explample of encode and decode without error correcting code?. Please.

from stegastamp.

tancik avatar tancik commented on June 1, 2024

I'm not going to be able to write out a full example, but I can give some pointers.
For encoding, just change packet_binary to the 50 bit binary code you want to store. You can ignore all of the previous lines regarding BCH.

packet_binary = ''.join(format(x, '08b') for x in packet)

For decoding,

secret = sess.run([output_secret],feed_dict=feed_dict)[0][0]

secret will contain your 50 bit message. All lines after can be ignored.

Also given that this is unrelated to the original issue, please create new issues for followup questions.

from stegastamp.

edwardocano avatar edwardocano commented on June 1, 2024

Thanks! I understand, I saw an example with a image encoded with 50 bits. So i tought you had an example.

from stegastamp.

fujiaixin09 avatar fujiaixin09 commented on June 1, 2024

no,though it is empty,it also can use without error.

Hi,gslxr,I also had this problem“ValueError: Cannot feed value of shape (1, 100) for Tensor 'input_prep:0', which has shape '(?, 20)'”,how did you solve it?

from stegastamp.

gslxr avatar gslxr commented on June 1, 2024

from stegastamp.

fujiaixin09 avatar fujiaixin09 commented on June 1, 2024

from stegastamp.

gslxr avatar gslxr commented on June 1, 2024

from stegastamp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.