In the process of testing the health of the model , in the console I see a warning message, although everything works correctly.
Loading network.....
Network successfully loaded
/home/y700/Env/yolo/lib/python3.6/site-packages/torch/nn/modules/upsampling.py:129: **UserWarning: nn.Upsample is deprecated. Use nn.functional.interpolate instead**.
warnings.warn("nn.{} is deprecated. Use nn.functional.interpolate instead.".format(self.name))
dog-cycle-car.png predicted in 0.111 seconds
Objects Detected: bicycle truck dog
I changed my code from
upsample=nn.Upsample(scale_factor=2;mode="nearest")
to
upsample = nn.functional.interpolate(scale_factor=2, mode="nearest")
and got this
Loading network.....
Traceback (most recent call last):
File "detector.py", line 63, in <module>
model = Darknet(args.cfgfile)
File "/home/y700/projects/yolo_start/darknet.py", line 164, in __init__
self.net_info, self.module_list = create_modules(self.blocks)
File "/home/y700/projects/yolo_start/darknet.py", line 109, in create_modules
upsample = nn.functional.interpolate(scale_factor=2, mode="nearest")
**TypeError: interpolate() missing 1 required positional argument: 'input'**
After I added argument ‘input’ (but I do not know what this argument means, I just wrote it)
upsample = nn.functional.interpolate(input, scale_factor=2, mode="nearest")
and got this:
Loading network.....
Traceback (most recent call last):
File "detector.py", line 63, in <module>
model = Darknet(args.cfgfile)
File "/home/y700/projects/yolo_start/darknet.py", line 164, in __init__
self.net_info, self.module_list = create_modules(self.blocks)
File "/home/y700/projects/yolo_start/darknet.py", line 109, in create_modules
upsample = nn.functional.interpolate(input, scale_factor=2, mode="nearest")
File "/home/y700/Env/yolo/lib/python3.6/site-packages/torch/nn/functional.py", line 2426, in interpolate
if input.dim() == 3 and mode == 'nearest':
**AttributeError: 'builtin_function_or_method' object has no attribute 'dim'**
Now I have no idea what to do next. These messages do not affect the operation of the model, but I want cleanliness.