json.load报错AttributeError: ‘str‘ object has no attribute ‘load‘ 要写个简单的数据处理脚本,报错AttributeError: ‘str’ object has no attribute ‘load’,查看了一下,路径正确,查了半天博客,不知道错在哪里。函数外面循环中的全局变量命名为json,循环中进入了报错的函数。
EfficientVit报错:TypeError: EfficientViT_M4() got an unexpected keyword argument ‘pretrained_cfg_over‘ 环境装的timm库太新了,0.9.几,花了一早上没解决,最后看了一下EfficientVit的requirements,人家装的是0.5.4版本,卸了重装timm库,解决。
Python报错:a bytes-like object is required, not ‘JpegImageFile‘ 参考这篇文章:https://blog.csdn.net/qq_44824148/article/details/121094400。这两天在跑DETR代码的时候,跑到image = Image.fromarray(np)的时候报错。改一下倒数第二行代码就运行成功了。
VsCode报错:No such file or directory:‘文件名‘ 昨天用VsCode直接打开py文件,运行后显示No such file or directory:‘directory’。但directory文件和该py文件在同一目录。直接打开py文件,Vscode看不到同一目录下的其他文件。打开文件夹打开该目录,而不是单独打开该py文件,即解决。