Giter VIP home page Giter VIP logo

pixel-recursive-super-resolution's Introduction

nilboy's GitHub stats-Dark

Top Langs

pixel-recursive-super-resolution's People

Contributors

nilboy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pixel-recursive-super-resolution's Issues

help!

您好,感謝您提供的程式碼,
我根據您提供的程式在執行上遇到了這些問題,請問應該如何解決?
謝謝您
Not a JPEG file: starts with 0x3d 0x3d
Done training -- epoch limit reached
Traceback (most recent call last):
File "C:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1039, in _do_call
return fn(*args)
File "C:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1021, in _run_fn
status, run_metadata)
File "C:\Program Files\Anaconda3\lib\contextlib.py", line 66, in exit
next(self.gen)
File "C:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\framework\errors_impl.py", line 466, in raise_exception_on_not_ok_status
pywrap_tensorflow.TF_GetCode(status))
tensorflow.python.framework.errors_impl.InvalidArgumentError: Invalid JPEG data, size 6080
[[Node: DecodeJpeg = DecodeJpegacceptable_fraction=1, channels=3, dct_method="", fancy_upscaling=true, ratio=1, try_recover_truncated=false, _device="/job:localhost/replica:0/task:0/cpu:0"]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "train.py", line 26, in
tf.app.run()
File "C:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\platform\app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "train.py", line 23, in main
solver.train()
File "C:\Users\User\Desktop\PRSR\tools\solver.py", line 88, in train
coord.join(threads)
File "C:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\training\coordinator.py", line 389, in join
six.reraise(*self._exc_info_to_raise)
File "C:\Program Files\Anaconda3\lib\site-packages\six.py", line 686, in reraise
raise value
File "C:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\training\queue_runner_impl.py", line 234, in _run
sess.run(enqueue_op)
File "C:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 778, in run
run_metadata_ptr)
File "C:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 982, in _run
feed_dict_string, options, run_metadata)
File "C:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1032, in _do_run
target_list, options, run_metadata)
File "C:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1052, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Invalid JPEG data, size 6080
[[Node: DecodeJpeg = DecodeJpegacceptable_fraction=1, channels=3, dct_method="", fancy_upscaling=true, ratio=1, try_recover_truncated=false, _device="/job:localhost/replica:0/task:0/cpu:0"]]

Caused by op 'DecodeJpeg', defined at:
File "train.py", line 26, in
tf.app.run()
File "C:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\platform\app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "train.py", line 22, in main
solver = Solver()
File "C:\Users\User\Desktop\PRSR\tools\solver.py", line 36, in init
self.dataset = DataSet(conf.imgs_list_path, self.num_epoch, self.batch_size)
File "C:\Users\User\Desktop\PRSR\tools\data.py", line 18, in init
image = tf.image.decode_jpeg(image_file, 3)
File "C:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\ops\gen_image_ops.py", line 345, in decode_jpeg
dct_method=dct_method, name=name)
File "C:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 768, in apply_op
op_def=op_def)
File "C:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 2336, in create_op
original_op=self._default_original_op, op_def=op_def)
File "C:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 1228, in init
self._traceback = _extract_stack()

InvalidArgumentError (see above for traceback): Invalid JPEG data, size 6080
[[Node: DecodeJpeg = DecodeJpegacceptable_fraction=1, channels=3, dct_method="", fancy_upscaling=true, ratio=1, try_recover_truncated=false, _device="/job:localhost/replica:0/task:0/cpu:0"]]

AttributeError: 'module' object has no attribute 'losses'

thanks for your code!!!!
now when i run python tools/train.py:
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcublas.so locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcudnn.so.5 locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcufft.so locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcurand.so locally
Traceback (most recent call last):
File "tools/train.py", line 26, in
tf.app.run()
File "/usr/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 43, in run
sys.exit(main(sys.argv[:1] + flags_passthrough))
File "tools/train.py", line 22, in main
solver = Solver()
File "/home/wangkun/prsr/solver.py", line 37, in init
self.net = Net(self.dataset.hr_images, self.dataset.lr_images, 'prsr')
File "/home/wangkun/prsr/net.py", line 18, in init
self.construct_net(hr_images, lr_images)
File "/home/wangkun/prsr/net.py", line 82, in construct_net
loss1 = self.softmax_loss(self.prior_logits + self.conditioning_logits, labels)
File "/home/wangkun/prsr/net.py", line 68, in softmax_loss
return tf.losses.sparse_softmax_cross_entropy(
AttributeError: 'module' object has no attribute 'losses'
[wangkun@mediaszu prsr]$ python tools/train.py
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcublas.so locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcudnn.so.5 locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcufft.so locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcurand.so locally
Traceback (most recent call last):
File "tools/train.py", line 26, in
tf.app.run()
File "/usr/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 43, in run
sys.exit(main(sys.argv[:1] + flags_passthrough))
File "tools/train.py", line 22, in main
solver = Solver()
File "/home/wangkun/prsr/solver.py", line 37, in init
self.net = Net(self.dataset.hr_images, self.dataset.lr_images, 'prsr')
File "/home/wangkun/prsr/net.py", line 18, in init
self.construct_net(hr_images, lr_images)
File "/home/wangkun/prsr/net.py", line 82, in construct_net
loss1 = self.softmax_loss(self.prior_logits + self.conditioning_logits, labels)
File "/home/wangkun/prsr/net.py", line 68, in softmax_loss
return tf.losses.sparse_softmax_cross_entropy(
AttributeError: 'module' object has no attribute 'losses'

I tried to solve the problem by myself but failed

在实现gated cnn时候左边用vertical mask右边用horizontal mask。但是代码中好像不是这么实现的?

首先非常感谢你提供的源代码!

在代码中有一段和我的理解有些出入,不知道是否我对代码的理解有偏差,请指正:
按照我的理解,左右两边的mask应该如下图所示:
image
但是在代码中https://github.com/nilboy/pixel-recursive-super-resolution/blob/master/ops.py#L30
对应右边的mask应该是mask A 和 B。这两种mask的区别在于是否包含中心点。可是mask经过 mask C 再判断A 和 B 的话就变成将左边和右边融合到一起了。拿 mask A 举例,它变成了下图:
image

请问这个应该怎么解释才通呢?

------- 5 Aug, update -------

另外还有一个疑惑是在 conditioning_network 里边 (https://github.com/nilboy/pixel-recursive-super-resolution/blob/master/net.py#L56)
原文中是直接连接下一个ResNet block,这里为何要加一层ReLU呢?

@nilboy @luckyboysmith 感谢说明!!

Load a model and resume training?

Is there a way to load the model and resume training? I am training on approx 75k images and it is taking almost 2 days (GTX 1080). So is there any way to resume training from the last checkpoint?

Is the printed images among the training dataset?

Hi Nilboy,

Thanks a lot for sharing the code, and I am using it for my research now. I appreciate for your effort so much.

I have a quick question about printed out images from sample function.
It seems you pulled out imageset from train.shuffle_batch in DataSet class, and print them out every N iterations. Can I assume that the printed image is from training set so? Which neural net already used for training at some point? (I am curious that you did divide training set and test set separately. I guess no. But in case my ignorance in tensor flow in general may disguised myself)

Thank you,
Soo

Change of data to use

I want to load and learn separately the low-resolution image and high-resolution image that I made by myself. Is there any method?

求助!

你好,非常感谢你的代码
我在按照您的步骤进行测试时候 我从celebA数据集中 用了17w张图片
迭代了10w次 在3w次后loss基本趋于稳定 可是
我的测试结果不好 眼睛都分不清 面部就是几个方块
看到您的测试结果 您的结果可谓是眉清目秀我的结果不忍直视 我觉得是我这边的问题(但是我不清楚我该怎么做)
虽然问题很模糊 不过还是希望能得到你的帮助
能给点建议什么的吗 谢谢!

Therminal stucked after 1000 iterations

Hi,

I finally managed to make the code run, but after 1000 steps my Terminal is writing:
iters 1000: , and nothing afterward. I saw that I don't have any new model or sample at those files at the folders, anyone knows how to fix this issue?

New Super-Resolution Benchmarks

Hello,

MSU Graphics & Media Lab Video Group has recently launched two new Super-Resolution Benchmarks.

If you are interested in participating, you can add your algorithm following the submission steps:

We would be grateful for your feedback on our work!

TypeError: Expected int32, got list containing Tensors of type '_Message' instead.

Hi, when i ran the scripts, i got the following error,
Traceback (most recent call last):
File "train.py", line 26, in
tf.app.run()
File "/home/software/local/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 30, in run
sys.exit(main(sys.argv[:1] + flags_passthrough))
File "train.py", line 22, in main
solver = Solver()
File "/local/home/share/xujinchang/project/learn_pytorch/pixel-recursive-super-resolution-master/solver.py", line 38, in init
self.net = Net(self.dataset.hr_images, self.dataset.lr_images, 'prsr')
File "/local/home/share/xujinchang/project/learn_pytorch/pixel-recursive-super-resolution-master/net.py", line 18, in init
self.construct_net(hr_images, lr_images)
File "/local/home/share/xujinchang/project/learn_pytorch/pixel-recursive-super-resolution-master/net.py", line 82, in construct_net
self.prior_logits = self.prior_network(hr_images)
File "/local/home/share/xujinchang/project/learn_pytorch/pixel-recursive-super-resolution-master/net.py", line 39, in prior_network
prior_logits = tf.concat([prior_logists0,prior_logists1,prior_logists2],3)
File "/home/software/local/lib/python2.7/site-packages/tensorflow/python/ops/array_ops.py", line 865, in concat
dtype=dtypes.int32).get_shape(
File "/home/software/local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 662, in convert_to_tensor
ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
File "/home/software/local/lib/python2.7/site-packages/tensorflow/python/framework/constant_op.py", line 180, in _constant_tensor_conversion_function
return constant(v, dtype=dtype, name=name)
File "/home/software/local/lib/python2.7/site-packages/tensorflow/python/framework/constant_op.py", line 163, in constant
tensor_util.make_tensor_proto(value, dtype=dtype, shape=shape))
File "/home/software/local/lib/python2.7/site-packages/tensorflow/python/framework/tensor_util.py", line 353, in make_tensor_proto
_AssertCompatible(values, dtype)
File "/home/software/local/lib/python2.7/site-packages/tensorflow/python/framework/tensor_util.py", line 290, in _AssertCompatible
(dtype.name, repr(mismatch), type(mismatch).name))
TypeError: Expected int32, got list containing Tensors of type '_Message' instead.
by the way, my tensorflow version is 0.11.0rc0.
Thanks a lot.

InvalidArgumentError (see above for traceback): Invalid JPEG data, size 1179648

再次打扰 程序运行中出现了错误 尝试了百度 无果 希望能得到您的帮助
E tensorflow/core/lib/jpeg/jpeg_mem.cc:221] Premature end of JPEG data. Stopped at line 3262/4256
step 4230, loss = 8.41 (20.3 examples/sec; 1.574 sec/batch)
Traceback (most recent call last):
File "tools/train.py", line 26, in
tf.app.run()
File "/usr/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 43, in run
sys.exit(main(sys.argv[:1] + flags_passthrough))
File "tools/train.py", line 23, in main
solver.train()
File "/home/wangkun/prsr/solver.py", line 88, in train
coord.join(threads)
File "/usr/lib/python2.7/site-packages/tensorflow/python/training/coordinator.py", line 386, in join
six.reraise(*self._exc_info_to_raise)
File "/usr/lib/python2.7/site-packages/tensorflow/python/training/queue_runner_impl.py", line 234, in _run
sess.run(enqueue_op)
File "/usr/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 766, in run
run_metadata_ptr)
File "/usr/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 964, in _run
feed_dict_string, options, run_metadata)
File "/usr/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1014, in _do_run
target_list, options, run_metadata)
File "/usr/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1034, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Invalid JPEG data, size 1179648
[[Node: DecodeJpeg = DecodeJpeg[acceptable_fraction=1, channels=3, fancy_upscaling=true, ratio=1,

try_recover_truncated=false, _device="/job:localhost/replica:0/task:0/cpu:0"](ReaderRead:1)]]
[[Node: ResizeBilinear_1/_15 = _Recv[client_terminated=false,

recv_device="/job:localhost/replica:0/task:0/gpu:7", send_device="/job:localhost/replica:0/task:0/cpu:0",

send_device_incarnation=1, tensor_name="edge_10_ResizeBilinear_1", tensor_type=DT_FLOAT,

_device="/job:localhost/replica:0/task:0/gpu:7"]()]]

Caused by op u'DecodeJpeg', defined at:
File "tools/train.py", line 26, in
tf.app.run()
File "/usr/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 43, in run
sys.exit(main(sys.argv[:1] + flags_passthrough))
File "tools/train.py", line 22, in main
solver = Solver()
File "/home/wangkun/prsr/solver.py", line 36, in init
self.dataset = DataSet(conf.imgs_list_path, self.num_epoch, self.batch_size)
File "/home/wangkun/prsr/data.py", line 18, in init
image = tf.image.decode_jpeg(image_file, 3)
File "/usr/lib/python2.7/site-packages/tensorflow/python/ops/gen_image_ops.py", line 311, in decode_jpeg
name=name)
File "/usr/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 759, in apply_op
op_def=op_def)
File "/usr/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2240, in create_op
original_op=self._default_original_op, op_def=op_def)
File "/usr/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1128, in init
self._traceback = _extract_stack()

InvalidArgumentError (see above for traceback): Invalid JPEG data, size 1179648
[[Node: DecodeJpeg = DecodeJpeg[acceptable_fraction=1, channels=3, fancy_upscaling=true, ratio=1,

try_recover_truncated=false, _device="/job:localhost/replica:0/task:0/cpu:0"](ReaderRead:1)]]
[[Node: ResizeBilinear_1/_15 = _Recv[client_terminated=false,

recv_device="/job:localhost/replica:0/task:0/gpu:7", send_device="/job:localhost/replica:0/task:0/cpu:0",

send_device_incarnation=1, tensor_name="edge_10_ResizeBilinear_1", tensor_type=DT_FLOAT,

_device="/job:localhost/replica:0/task:0/gpu:7"]()]]

problems——solver

Traceback (most recent call last):
File "tools/train.py", line 2, in
from solver import *
ImportError: No module named solver

how to solve?

The code does not work with the new tensorflow versions.

I tried to follow the requirements (Python 2.7, Skimage, TensorFlow 1.0), but I couldn't install them because I was having a conflict between the packages, so I installed the latest versions, which work until the training crashes.
Would it be possible to update the code to the latest version of TensorFlow, and Python >= 3.0?

Test time is too high

Hi @nilboy , I managed to write a code to test the models against my test data (single images or many, based on my need), but the test time per image is coming out to be too high approx 40 sec per image. Ideally it should be in milliseconds. Also, according to my observation this line in the test code is taking a lot of time to execute, and on top of it , this line is executed 32x32x3 times (approx 3k times) and hence the delay.

Any way of reducing the test time? or if possible can you upload a code for testing?

Not a JPEG file

when I run the program,it has some problems such as 'Not a JPEG file: starts with 0x3d 0x3d' and 'Caused by op 'DecodeJpeg', defined at:......' I think the problem comes from the CelebA data,how can I solve it?

请问训练完成后怎么测试图片?

非常感谢你无私提供的代码 在你的帮助下 我的运行遇到的问题已经解决
现在程序正在运行
我想咨询一下 在训练结束后 怎么测试图片?也就是怎么利用一张实际的图片去测试效果
我是新手 不知道自己对问题的描述是否清楚
谢谢!

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.