请问为什么我直接替换yolov8的Conv会出现报错
Traceback (most recent call last):
File "/home/ubuntu/ultralytics-main/Mytrain.py", line 4, in
model = YOLO("/home/ubuntu/ultralytics-main/ultralytics/cfg/models/v8/yolov8_test.yaml") # 从头开始构建新模型
File "/home/ubuntu/ultralytics-main/ultralytics/engine/model.py", line 89, in init
self._new(model, task)
File "/home/ubuntu/ultralytics-main/ultralytics/engine/model.py", line 118, in _new
self.model = (model or self._smart_load('model'))(cfg_dict, verbose=verbose and RANK == -1) # build model
File "/home/ubuntu/ultralytics-main/ultralytics/nn/tasks.py", line 233, in init
self.model, self.save = parse_model(deepcopy(self.yaml), ch=ch, verbose=verbose) # model, savelist
File "/home/ubuntu/ultralytics-main/ultralytics/nn/tasks.py", line 689, in parsemodel
m = nn.Sequential((m(args) for _ in range(n))) if n > 1 else m(*args) # module
File "/home/ubuntu/ultralytics-main/ultralytics/nn/modules/conv.py", line 856, in init
self.CRU = CRU( op_channel,
File "/home/ubuntu/ultralytics-main/ultralytics/nn/modules/conv.py", line 820, in init
self.squeeze2 = nn.Conv2d(low_channel,low_channel//squeeze_radio,kernel_size=1,bias=False)
File "/home/ubuntu/anaconda3/envs/v8/lib/python3.8/site-packages/torch/nn/modules/conv.py", line 450, in init
super().init(
File "/home/ubuntu/anaconda3/envs/v8/lib/python3.8/site-packages/torch/nn/modules/conv.py", line 137, in init
self.weight = Parameter(torch.empty(
RuntimeError: Trying to create tensor with negative dimension -64: [-64, -128, 1, 1]
请问为什么我直接替换yolov8的Conv会出现报错 Traceback (most recent call last): File "/home/ubuntu/ultralytics-main/Mytrain.py", line 4, in
model = YOLO("/home/ubuntu/ultralytics-main/ultralytics/cfg/models/v8/yolov8_test.yaml") # 从头开始构建新模型
File "/home/ubuntu/ultralytics-main/ultralytics/engine/model.py", line 89, in init
self._new(model, task)
File "/home/ubuntu/ultralytics-main/ultralytics/engine/model.py", line 118, in _new
self.model = (model or self._smart_load('model'))(cfg_dict, verbose=verbose and RANK == -1) # build model
File "/home/ubuntu/ultralytics-main/ultralytics/nn/tasks.py", line 233, in init
self.model, self.save = parse_model(deepcopy(self.yaml), ch=ch, verbose=verbose) # model, savelist
File "/home/ubuntu/ultralytics-main/ultralytics/nn/tasks.py", line 689, in parsemodel
m = nn.Sequential((m(args) for _ in range(n))) if n > 1 else m(*args) # module
File "/home/ubuntu/ultralytics-main/ultralytics/nn/modules/conv.py", line 856, in init
self.CRU = CRU( op_channel,
File "/home/ubuntu/ultralytics-main/ultralytics/nn/modules/conv.py", line 820, in init
self.squeeze2 = nn.Conv2d(low_channel,low_channel//squeeze_radio,kernel_size=1,bias=False)
File "/home/ubuntu/anaconda3/envs/v8/lib/python3.8/site-packages/torch/nn/modules/conv.py", line 450, in init
super().init(
File "/home/ubuntu/anaconda3/envs/v8/lib/python3.8/site-packages/torch/nn/modules/conv.py", line 137, in init
self.weight = Parameter(torch.empty(
RuntimeError: Trying to create tensor with negative dimension -64: [-64, -128, 1, 1]