问题描述:
UserWarning: loadtxt: Empty input file: "/home/zh/PytorchProjects/00-DataSet/COCO2014/labels/train2014/COCO_train2014_000000195266.txt
这只是一个使用警告,并不影响使用。警告loadtxt()函数可能读入空文件。
解决方案:
import warnings
with warnings.catch_warnings():
warnings.simplefilter('ignore')
boxes = np.loadtxt(label_path)
本文介绍了一种在Python中使用numpy的loadtxt函数读取空文件时出现警告的常见问题,并提供了一个简单的解决方案,通过忽略警告来避免干扰程序运行。
1504

被折叠的 条评论
为什么被折叠?



