huawei-noah / Pretrained-IPT

Apache License 2.0
424 stars 63 forks source link

The shape of the two input elements of the Concat operator do not match #19

Open hgxy15 opened 2 years ago

hgxy15 commented 2 years ago

Dear developers of IPT,

Thanks for making this code publicly available, I have installed mindspore-gpu 1.5.0rc1 on a cuda10.1 machine. I'm currently trying to run the denoising task on the 512*512 png file, however, after successfully loading the mindspore net, I get the following error:

20 load mindspore net successfully. 21 Getting item 0 22 (1, 6, 48, 468) 23 (1, 12, 48, 480) 24 25 [WARNING] PIPELINE(27151,2b9f2f4d9380,python):2021-10-01-19:44:41.378.607 [mindspore/ccsrc/pipeline/jit/init.cc:310] operator()] Start releasing dataset hand les... 26 [WARNING] PIPELINE(27151,2b9f2f4d9380,python):2021-10-01-19:44:41.379.208 [mindspore/ccsrc/pipeline/jit/init.cc:313] operator()] End release dataset handles. 27 Traceback (most recent call last): 28 File "eval.py", line 96, in 29 eval_net() 30 File "eval.py", line 81, in eval_net 31 pred = inference.forward(lr, idx) 32 File "/Share2/home/huanggao/software/mindspore/model_zoo/research/cv/IPT-cryoEM/src/ipt_model.py", line 656, in forward 33 w_cut, padsize, shave, scale, batchsize) 34 File "/Share2/home/huanggao/software/mindspore/model_zoo/research/cv/IPT-cryoEM/src/ipt_model.py", line 747, in cut_h_new 35 concat1 = self.cc_3((y_h_cut[:, :, :, :int(shave / 2 scale)], y_h_cut_inter)) 36 File "/Share/home/huanggao/.local/lib/python3.7/site-packages/mindspore/ops/primitive.py", line 247, in call 37 return _run_op(self, self.name, args) 38 File "/Share/home/huanggao/.local/lib/python3.7/site-packages/mindspore/common/api.py", line 77, in wrapper 39 results = fn(arg, **kwargs) 40 File "/Share/home/huanggao/.local/lib/python3.7/site-packages/mindspore/ops/primitive.py", line 682, in _run_op 41 output = real_run_op(obj, op_name, args) 42 File "/Share/home/huanggao/.local/lib/python3.7/site-packages/mindspore/ops/operations/arrayops.py", line 2361, in infer 43 , allshp, = get_concat_offset(x_shp, x_type, axis, self.name) 44 File "/Share/home/huanggao/.local/lib/python3.7/site-packages/mindspore/ops/_utils/utils.py", line 96, in get_concat_offset 45 raise ValueError(f"The shape of the two input elements of the Concat operator do not match:" 46 ValueError: The shape of the two input elements of the Concat operator do not match:shape[0] = [1, 12, 48, 6] and shape[1] = [1, 6, 48, 468].

line 22-23 are the shape of y_h_cut_inter and y_h_cut I printed out.

Could you please give me some help here ?

Many thanks in advance ! Gaoxing