tancik / StegaStamp

Invisible Hyperlinks in Physical Photographs
http://www.matthewtancik.com/stegastamp
MIT License
689 stars 193 forks source link

How to convert encoded_image from tensor to numpy ? #45

Open Lee-meng-meng opened 2 years ago

Lee-meng-meng commented 2 years ago

The encoded_image in the network has always been operated in the form of a tensor. When I want to make some changes to the noise layer, I find that I cannot directly assign a value to the tensor, so I want to convert the encoded_image to the form of an array first. I use sess.run and .eval() both failed. Is there any solution? Thank you very much! ! ! ! ! !

Github-Shaw commented 2 years ago

我最近也在研究这个模型,可以留个联系方式交流一下吗

monument-and-sea-all-the-gift commented 2 years ago

网络中的encoded_image一直以张量的形式进行操作。当我想对噪声层进行一些更改时,我发现我无法直接为张量赋值,所以我想先将encoded_image转换为数组的形式。我使用 sess.run 和 .eval() 都失败了。有什么解决办法吗?非常感谢!!!!!!

没试过.cpu().detach().numpy()么