CycleGAN icon indicating copy to clipboard operation
CycleGAN copied to clipboard

train.lua crashes with batchSize bigger than 1

Open dmas-at-wiris opened this issue 7 years ago • 3 comments

[...]/torch/install/bin/luajit: [...]/torch/install/share/lua/5.1/image/init.lua:176: [write_png_file] Depth must be 1, 3 or 4 stack traceback:
[C]: in function 'save' /data/software/torch/install/share/lua/5.1/image/init.lua:176: in function 'saver'
/data/software/torch/install/share/lua/5.1/image/init.lua:442: in function 'save'
./util/visualizer.lua:50: in function 'save_results'
train.lua:96: in function 'save_current_results'
train.lua:154: in main chunk
[C]: in function 'dofile'
[...]/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
[C]: at 0x00405d50

dmas-at-wiris avatar Apr 25 '17 13:04 dmas-at-wiris

Yes, same here. Anyone found a patch for this?

Quasimondo avatar May 19 '17 16:05 Quasimondo

Since the error occurs in visualizer.save_current_results one temporary patch is to comment out the part that calls it in train.lua (line 154):

if counter % opt.save_display_freq == 0 then
 --save_current_results(epoch, counter)
end

Quasimondo avatar May 19 '17 16:05 Quasimondo

I fixed the bugs in the save_current_results. Let me know if it works for you with batchSize>1

junyanz avatar Jun 18 '17 07:06 junyanz