ssecv / LeNo

The official implementation of AAAI 2023 "LeNo: Adversarial Robust Salient Object Detection Networks with Learnable Noise"
16 stars 3 forks source link

test error #2

Open lixiangamy opened 1 year ago

lixiangamy commented 1 year ago

Traceback (most recent call last): File "/home/notebook/data/group/lixiang/ali/envs/mmdet_xyc/lib/python3.7/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/home/notebook/data/group/lixiang/ali/envs/mmdet_xyc/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/init/code-server-3.9.1-linux-x86_64/.share/extensions/ms-python.python-2021.2.633441544/pythonFiles/lib/python/debugpy/main.py", line 45, in cli.main() File "/init/code-server-3.9.1-linux-x86_64/.share/extensions/ms-python.python-2021.2.633441544/pythonFiles/lib/python/debugpy/../debugpy/server/cli.py", line 444, in main run() File "/init/code-server-3.9.1-linux-x86_64/.share/extensions/ms-python.python-2021.2.633441544/pythonFiles/lib/python/debugpy/../debugpy/server/cli.py", line 285, in run_file runpy.run_path(target_as_str, run_name=compat.force_str("main")) File "/home/notebook/data/group/lixiang/ali/envs/mmdet_xyc/lib/python3.7/runpy.py", line 263, in run_path pkg_name=pkg_name, script_name=fname) File "/home/notebook/data/group/lixiang/ali/envs/mmdet_xyc/lib/python3.7/runpy.py", line 96, in _run_module_code mod_name, mod_spec, pkg_name, script_name) File "/home/notebook/data/group/lixiang/ali/envs/mmdet_xyc/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/notebook/data/group/lixiang/breeno_xyc/LeNo/test.py", line 95, in main() File "/home/notebook/data/group/lixiang/breeno_xyc/LeNo/test.py", line 49, in main prediction = net(img_var) File "/home/notebook/data/group/lixiang/ali/envs/mmdet_xyc/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl return forward_call(*input, **kwargs) File "/home/notebook/data/group/lixiang/breeno_xyc/LeNo/model_ours.py", line 235, in forward self.final_noise = self.perf.expand(x.size()) RuntimeError: The expanded size of the tensor (1040) must match the existing size (192) at non-singleton dimension 3. Target sizes: [1, 64, 780, 1040]. Tensor sizes: [64, 192, 192]

chciw commented 1 year ago

你好,看起来是tensor尺寸出了问题,少一个维度batch,宽和高也不对。可以重点检查一下图像预处理。

kexi0714 commented 1 week ago

回溯(最近一次调用最后一次): 文件“/home/notebook/data/group/lixiang/ali/envs/mmdet_xyc/lib/python3.7/runpy.py”,第193行,在 _run_module_as_main “ main ”,mod_spec) 文件“/home/notebook/data/group/lixiang/ali/envs/mmdet_xyc/lib/python3.7/runpy.py”,第85行,在_run_code exec(code,run_globals) 文件“/init/code-server-3.9.1-linux-x86_64/.share/extensions/ms-python.python-2021.2.633441544/pythonFiles/lib/python/debugpy/ main .py” ,第45集 行,在 cli.main() 文件中“/init/code-server-3.9.1-linux-x86_64/.share/extensions/ms-python.python-2021.2.633441544/pythonFiles/lib/python/debugpy/。 ./debugpy/server/cli.py”,第 444 条行,在主 运行() 文件中“/init/code-server-3.9.1-linux-x86_64/.share/extensions/ms-python.python-2021.2.633441544/pythonFiles/lib/python/debugpy/.. /debugpy/server/cli.py”,第 285 行,在 run_file runpy.run_path(target_as_str,run_name=compat.force_str(“ main ”)) 文件中“/home/notebook/data/group/lixiang/ali/envs/mmdet_xyc/lib/python3.7/runpy.py”,第263行,在run_path中 pkg_name=pkg_name, script_name=fname) 文件“/home/notebook/data/group/lixiang/ali/envs/mmdet_xyc/lib/python3.7/runpy.py”,第96行,在_run_module_code中 mod_name, mod_spec, pkg_name, script_name) 文件“/home/notebook/data/group/lixiang/ali/envs/mmdet_xyc/lib/python3.7/runpy.py”,第85行,在_run_code中 exec(code, run_globals) 文件“/home/notebook/data/group/lixiang/breeno_xyc/LeNo/test.py”,第95行,在 main() 文件中“/home/notebook/data/group/lixiang/breeno_xyc/LeNo/ test.py”, 第 49 行, 在 main 中 预测 = net(img_var) 文件“/home/notebook/data/group/lixiang/ali/envs/mmdet_xyc/lib/python3.7/site-packages/torch/nn/modules/module.py”,第1110行,在_call_impl中 返回forward_call(*输入, **kwargs) 文件“/home/notebook/data/group/lixiang/breeno_xyc/LeNo/model_ours.py”,第235行,在forward中 self.final_noise = self.perf.expand(x.size()) RuntimeError: 张量的展开大小 (1040) 必须与非单例维度 3 处的现有大小 (192) 匹配。目标大小:[1, 64, 780, 1040 ].张量大小:[64, 192, 192] 您好 请问您复现成功了吗?