AMR icon indicating copy to clipboard operation
AMR copied to clipboard

ValueError: could not convert string '2007_000032' to int32 at row 0, column 1.

Open Dream-ai opened this issue 2 years ago • 2 comments

I have encountered such an error: Traceback (most recent call last): File "run_sample.py", line 114, in step.train_amr.run(args) File "/home/stuc/zhx/AMR-main/step/train_amr.py", line 49, in run train_dataset = voc12.dataloader.VOC12ClassificationDataset(args.train_list, voc12_root=args.voc12_root, File "/home/stuc/zhx/AMR-main/voc12/dataloader.py", line 167, in init super().init(img_name_list_path, voc12_root, File "/home/stuc/zhx/AMR-main/voc12/dataloader.py", line 115, in init self.img_name_list = load_img_name_list(img_name_list_path) File "/home/stuc/zhx/AMR-main/voc12/dataloader.py", line 60, in load_img_name_list img_name_list = np.loadtxt(dataset_path, dtype=np.int32) File "/home/stuc/.conda/envs/amr/lib/python3.8/site-packages/numpy/lib/npyio.py", line 1308, in loadtxt arr = _read(fname, dtype=dtype, comment=comment, delimiter=delimiter, File "/home/stuc/.conda/envs/amr/lib/python3.8/site-packages/numpy/lib/npyio.py", line 979, in _read arr = _load_from_filelike( ValueError: could not convert string '2007_000032' to int32 at row 0, column 1. Looking forward to your reply,thank you!!!!

Dream-ai avatar Oct 07 '22 08:10 Dream-ai

change like these: 1. img_name_list = np.loadtxt(dataset_path, dtype=str) 2. return np.int32(img_name_list)

ZY-Joying avatar Apr 15 '23 13:04 ZY-Joying

You should check whether the input of the ''args.train_list'' is correct. The normal input should be ''voc12/train.txt" or "voc12/val.txt".

JayQine avatar Dec 21 '23 13:12 JayQine