Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeError: For 'Reshape', the size of 'input_x': {3456} is not equal to the size of the first output: {5760} #9

Open
lulianLiu opened this issue Sep 22, 2022 · 0 comments

Comments

@lulianLiu
Copy link

I use the dataset you provided,but I can't train.How to solve this problem?

root@0563a279aa9b:/data# DEVICE_ID=0 python train.py
Start time : 2022-09-22 08:07:09

infos : {'dataset_path': './dataset/', 'backbone_pretrained': './src/model/res2net_pretrained.ckpt', 'dataset_train': 'PASCAL_SBD', 'datasets_val': ['GrabCut', 'Berkeley'], 'epochs': 33, 'train_only_epochs': 32, 'val_robot_interval': 1, 'lr': 0.007, 'batch_size': 8, 'max_num': 0, 'size': (384, 384), 'device': 'CPU', 'num_workers': 4, 'itis_pro': 0.7, 'max_point_num': 20, 'record_point_num': 5, 'pred_tsh': 0.5, 'miou_target': [0.9, 0.9], 'resume': None, 'snapshot_path': './snapshot'}

Traceback (most recent call last):
File "train.py", line 35, in
mine = Trainer(p)
File "/data/src/trainer.py", line 111, in init
size=p["size"][0], backbone_pretrained=p["backbone_pretrained"]
File "/data/src/model/fcanet.py", line 295, in init
resnet.load_pretrained_model(backbone_pretrained)
File "/data/src/model/res2net.py", line 267, in load_pretrained_model
tmp[:, :3, :, :] = parameter_dict["conv1_0.weight"]
File "/usr/local/python-3.7.5/lib/python3.7/site-packages/mindspore/common/tensor.py", line 344, in setitem
out = tensor_operator_registry.get('setitem')(self, index, value)
File "/usr/local/python-3.7.5/lib/python3.7/site-packages/mindspore/ops/composite/multitype_ops/_compile_utils.py", line 67, in _tensor_setitem
return tensor_setitem_by_tuple(self, index, value)
File "/usr/local/python-3.7.5/lib/python3.7/site-packages/mindspore/ops/composite/multitype_ops/_compile_utils.py", line 803, in tensor_setitem_by_tuple
return tensor_setitem_by_tuple_with_tensor(self, index, value)
File "/usr/local/python-3.7.5/lib/python3.7/site-packages/mindspore/ops/composite/multitype_ops/_compile_utils.py", line 956, in tensor_setitem_by_tuple_with_tensor
tuple_index, value, idx_advanced = remove_expanded_dims(tuple_index, F.shape(data), value)
File "/usr/local/python-3.7.5/lib/python3.7/site-packages/mindspore/ops/composite/multitype_ops/compile_utils.py", line 1156, in remove_expanded_dims
value = F.reshape(value, value_shape)
File "/usr/local/python-3.7.5/lib/python3.7/site-packages/mindspore/ops/function/array_func.py", line 857, in reshape
return reshape
(input_x, input_shape)
File "/usr/local/python-3.7.5/lib/python3.7/site-packages/mindspore/ops/primitive.py", line 294, in call
return _run_op(self, self.name, args)
File "/usr/local/python-3.7.5/lib/python3.7/site-packages/mindspore/common/api.py", line 98, in wrapper
results = fn(*arg, **kwargs)
File "/usr/local/python-3.7.5/lib/python3.7/site-packages/mindspore/ops/primitive.py", line 748, in _run_op
output = real_run_op(obj, op_name, args)
RuntimeError: For 'Reshape', the size of 'input_x': {3456} is not equal to the size of the first output: {5760}


  • C++ Call Stack: (For framework developers)

mindspore/ccsrc/plugin/device/cpu/kernel/memcpy_cpu_kernel.cc:37 Launch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant