filenotfounderror: [errno 2] no such file or directory: 'best.pt'
best.pt明明是存在的但是与所运行的文件不在同级目录下,所以
parser.add_argument('--weights', nargs='+', type=str, default='best.pt', help='model.pt path(s)')并找不到它,因此报错。
我的解决方法:将best.pt复制了一份放在同级目录下。
AttributeError: 'Namespace' object has no attribute 'weights'上一个问题解决之后这个问题也解决了。