jcreinhold / synthtorch

deep neural network-based image translation/synthesis
Other
27 stars 7 forks source link

nn-predict error #16

Closed mcbrs1a closed 5 years ago

mcbrs1a commented 5 years ago

Hi, training was successful with a 3D image volume, 64 by 64 patchsize, I am using the .json file for synthesis and using the same source image as training for prediction and receive this error, any suggestions?

synthtorch.exec.nn_predict - ERROR - list index out of range
Traceback (most recent call last):
  File "/home/c.mcbrs1/.conda/envs/synthtorch/lib/python3.7/site-packages/synthtorch/exec/nn_predict.py", line 71, in main
    out_imgs = learner.predict(fn, nsyn, args.calc_var)
  File "/home/c.mcbrs1/.conda/envs/synthtorch/lib/python3.7/site-packages/synthtorch/learn/learner.py", line 174, in predict
    out = self.predictor.predict(img, nsyn, calc_var)
  File "/home/c.mcbrs1/.conda/envs/synthtorch/lib/python3.7/site-packages/synthtorch/learn/predict.py", line 47, in predict
    out_img = self.patch_3d_predict(img, nsyn, calc_var)
  File "/home/c.mcbrs1/.conda/envs/synthtorch/lib/python3.7/site-packages/synthtorch/learn/predict.py", line 71, in patch_3d_predict
    [0, pad[2] if psz[2] != sz[3] else 0,
IndexError: list index out of range
(synthtorch) [c.mcbrs1@cl2 bin]$ 
jcreinhold commented 5 years ago

My best guess is that you need to set dim=2, since you are actually using a 2D network (if you made the patch size == [64,64]).

Re-open if this doesn't fix your problem, but please provide the version number (or, even better, the commit hash) of your installation of synthtorch and provide your modified config.json file.