dcscn-super-resolution icon indicating copy to clipboard operation
dcscn-super-resolution copied to clipboard

running sr on a png of 720*1280*3

Open UrYuWang opened this issue 5 years ago • 6 comments

When I check the img size, it turns to be 72012801, and an error shows: ResourceExhaustedError (see above for traceback): OOM when allocating tensor with shape[1,196,720,1280] [[Node: CNN1/CNN1_conv = Conv2D[T=DT_FLOAT, data_format="NHWC", padding="SAME", strides=[1, 1, 1, 1], use_cudnn_on_gpu=true, _device="/job:localhost/replica:0/task:0/gpu:0"](_recv_x_0/_293, CNN1/conv_W/read)]] [[Node: output/_299 = _Recvclient_terminated=false, recv_device="/job:localhost/replica:0/task:0/cpu:0", send_device="/job:localhost/replica:0/task:0/gpu:0", send_device_incarnation=1, tensor_name="edge_189_output", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/cpu:0"]]

Can you tell me whether it is because of my device?

UrYuWang avatar May 11 '19 02:05 UrYuWang

Hi, the input shape is 196 * 720 * 1280. It looks you are feeding 196 images at once. It's obvious that you don't have an enough memory to process it at once.

I don't know you are using the model, but that is the reason. Thx!

jiny2001 avatar May 12 '19 00:05 jiny2001

Hi, Jin. Thanks for your reply. I have converted my code to make it work. RIght now, each frame of mp4 seems to be 3-channeled. Do you think I should modify the model to 3-channeled and get a better performance?

Have a nice day. Yu

Jin Yamanaka [email protected] 于2019年5月11日周六 下午8:06写道:

Hi, the input shape is 196 * 720 * 1280. It looks you are feeding 196 images at once. It's obvious that you don't have an enough memory to process it at once.

I don't know you are using the model, but that is the reason. Thx!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jiny2001/dcscn-super-resolution/issues/81#issuecomment-491553171, or mute the thread https://github.com/notifications/unsubscribe-auth/AGP4WDOPQT253QWCQ33DUCLPU5NPZANCNFSM4HMHDWAQ .

-- Have a good day. Yu

UrYuWang avatar May 12 '19 00:05 UrYuWang

Hi Yu,

It would be not so difficult to modify my model for 3ch input/output if you are familiar with tensor flow. But you need to train the model again.

However, I guess you can try using my DCSCN.py / do_for_file() for the first. https://github.com/jiny2001/dcscn-super-resolution/blob/master/DCSCN.py#L538

You can give 3ch image instead of loading from file at the top of the function. It will convert to YCbCr plane, apply SR to Y plane and then take it back to RGB and return it.

jiny2001 avatar May 12 '19 01:05 jiny2001

Hi, Jin. This is what I do. I wonder if the performance can improve after I modify the model and retrain it. You exactly described how I do: instead of loading the picture from a png file, I load the picture from each frame of a video. Then I use your model to do super-resolution, then put the new frames back there to create a new video.

If you have trained your model with RGB channel, let me know if the performance is better. Thanks for your response:) Enjoy your night. Yu

Jin Yamanaka [email protected] 于2019年5月11日周六 下午9:46写道:

Hi Yu,

It would be not so difficult to modify my model for 3ch input/output if you are familiar with tensor flow. But you need to train the model again.

However, I guess you can try using my DCSCN.py / do_for_file() for the first.

https://github.com/jiny2001/dcscn-super-resolution/blob/master/DCSCN.py#L538

You can give 3ch image instead of loading from file at the top of the function. It will convert to YCbCr plane, apply SR to Y plane and then take it back to RGB and return it.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jiny2001/dcscn-super-resolution/issues/81#issuecomment-491557336, or mute the thread https://github.com/notifications/unsubscribe-auth/AGP4WDIS5OI7DGTYRKX4D3DPU5ZGLANCNFSM4HMHDWAQ .

-- Have a good day. Yu

UrYuWang avatar May 12 '19 02:05 UrYuWang

That's great you already tried that. I'm sure it will have a little better performance when I trained with RGB data.

However, currently I'm working on the other project and using my GPU for that. Will let you know when I tried and updated the model. Thx!

jiny2001 avatar May 12 '19 02:05 jiny2001

Hi, the input shape is 196 * 720 * 1280. It looks you are feeding 196 images at once. It's obvious that you don't have an enough memory to process it at once.

I don't know you are using the model, but that is the reason. Thx!

Hi @UrYuWang and @jiny2001 ,

I am loading only 1 image and with dimension [1809,1164] and getting the issue

Resource exhausted: OOM when allocating tensor with shape[1,108,1809,1164] and type float on /job:localhost/replica:0/task:0/device:GPU:0 by allocator @#GPU_0_bfc

Now I don’t understand why it is showing me 108 even though I have loaded only one image. Can you please help me with that

nareshmungpara avatar Dec 12 '19 05:12 nareshmungpara