-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IndexError: list index out of range #7
Comments
-- Make sure you have .jpg images:
-- If you have .png images change the image types to .png. -- Make sure you have correct path here: Line 27 in 7aaae20
-- Here: Line 28 in 7aaae20
-- And here: Line 101 in 7aaae20
-- Make sure to put ''/" at the end of directory address. |
Thanks !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
@jinzhenmu Were you able to fix this issue? I'm getting the same error. |
The problem lies with this variable: self.imgs_gt. The program does not able to get the data somehow. This is the only problem, I think.
Try to follow my first comment in this issue. I hope it would help. |
这个问题,我当时解决了。注意查看json文件里面的配置。主要关注数据集的路径。
| |
牟金震
邮箱:[email protected]
|
签名由 网易邮箱大师 定制
On 10/09/2020 22:00, Jakaria Rabbi wrote:
The problem lies with this variable: self.imgs_gt. The program does not able to get the data somehow. This is the only problem, I think.
Try to print the variable to see what it contains.
Here: https://github.com/Jakaria08/EESRGAN/blob/7aaae20752e13566dcf119ff1d1d521d0184f6aa/scripts_for_datasets/COWC_EESRGAN_FRCNN_dataset.py#L25
Try to follow my first comment in this issue. I hope it would help.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
I just noticed that my error was a little different. For me, it's From the pretrainied weights, I was able to get the following:
What should I do for the data other than this in `/home/jakaria/Super_Resolution/Filter_Enhance_Detect/saved/*? @Jakaria08 @jinzhenmu Edit: I'm trying to reproduce the results using pretrained weights FYI |
in my case,I put the annotation *.txt files in HR,LR and Bic, but it should be put in HR/x4,after fixed this,I meet RuntimeError: CUDA out of memory. |
@cl886699 From where did you get those annotation files? Even I don't know how to generate the validation set. |
mybe copy_folder_name_for_valid_image (line of 92 in scripts_GAN_HR-LR.py) this function can get the validation data. |
@cl886699 But I don't have the data for |
val_images means validation datasets,you should split datasets to train,val and test, you should do it by yourself. if you just want to test this model, you can choose annother city's data to test |
Hey @cl886699, were you able to generate the validation set? I still can't figure that out. I'm also planning to work with the model other than just testing it. |
I'm getting this error now. I'd copied the annotation files and placed a single validation image in the folders.
|
Generated images are stored in this location: Line 76 in c646296
Make sure the directory path is ok. Create folders to create this path: Line 112 in c646296
"Test_Result_SR": "/[Your path from root]/[Your path]/[Your path]/EESRGAN/saved/Test_Result_SR/" I don't have any GPU access now, therefore I am not able to check my code for any issue related to pytorch version mismatch or creation of some folders that are needed to store images. I will check my code in a new GPU machine soon to update the hard-coded portion and pytorch version. I will also add more documentations if possible. |
@Jakaria08 I've checked the path and it's fine I think. Thank you for finding time to look at this. I hope you get the GPU access soon :) |
@themousepotato Did you solve this problem? I'm having the same issue. Thanks! |
I solved it already, if you need assitance ask me, maybe I can help you :) |
@MrCrowbar I haven't solved it. It would be great if you can help. Thanks for reaching out 😅 |
Ping @MrCrowbar just in case you've forgotten :) |
Hello guys! should i put only the validation image or also its .txt file? In the understanding I got from the project tutorial, I put an HR, LR and Bic image as an example in the valid_img folders after executing the scripts_GAN_HR-LR.py algorithm and also its .txt file, otherwise it would give an error. I ask for help, because the execution result is this: 400000 But when I go to the Test_Result_SR folder, the file does not open. I believe it is because of the result at the end of the execution. |
@MrCrowbar e @Jakaria08 help me. Thank you. |
Sorry for my late reply. The error you are getting is new to me. I am not sure what is happening. You need both the image and text files for evaluation. I didn't test it on google Colab. I will try to run the code on google Colab if I get time. @brenoslinhares |
@Jakaria08, I noticed that the line of code that is making the matrix error with number of rows and columns equal to zero is this: def draw_detection_boxes(new_class_conf_box, config, file_name, image): Could you please inform me, how to generate the images for this path? Thanks! |
@MrCrowbar, Could you tell me how you fixed your problem in the code, as reported above? |
Has the problem you mentioned been resolved? |
|
Hi , I am also getting the same error, Did you solve your issue? |
File "/home/gfzx/yjg/EESRGAN-master/scripts_for_datasets/COWC_EESRGAN_FRCNN_dataset.py", line 36, in getitem please!!!! i can not get the "annotation_path", its value is empty, how can i get it ???? |
hello , my question is the "annotation_path", its value is empty, can you help me solve it ? thank you!!! |
@brenoslinhares I have the same problem. I found that there is no code for generating images in output_images. 'output_images' is only mentioned in engine.py. I think the code is incomplete. |
@Jakaria08 You are supposed to generate these images in output_images during test in order to read and label them in draw_detection_boxes function but there is no way to make these output images in your implementation. |
Hi,I met the same problem with you, how did you solve it?if you have fixed it,could you tell me? please!!! |
I'm really sorry to reply to you now. The key to the problem is that the data set is not set correctly. This dataset cannot be used directly. It's too long. I forgot how to change it, but it's about the data set path.
At 2021-10-04 15:18:43, "wz" ***@***.***> wrote:
def draw_detection_boxes(new_class_conf_box, config, file_name, image):
source_image_path = os.path.join(config['path']['output_images'], file_name, file_name+'_112000_final_SR.png')
dest_image_path = os.path.join(config['path']['Test_Result_SR'], file_name+'.png')
image = cv2.imread(source_image_path, 1)
@Jakaria08 You are supposed to generate these images in output_images during test in order to read and label them in draw_detection_boxes function but there is no way to make these output images in your implementation.
Hi,I met the same problem with you, how did you solve it?if you have fixed it,could you tell me? please!!!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
|
python3 test.py -c config_GAN.json
480
[250000, 500000, 750000]
Traceback (most recent call last):
File "test.py", line 96, in
main(config)
File "test.py", line 19, in main
tester.test()
File "/home/mjz/2D_Detcetion/EESRGAN/trainer/cowc_GAN_FRCNN_trainer.py", line 38, in test
self.model.test(self.data_loader, train=False, testResult=True)
File "/home/mjz/2D_Detcetion/EESRGAN/model/ESRGAN_EESN_FRCNN_Model.py", line 273, in test
evaluate(self.netG, self.netFRCNN, self.targets, self.device)
File "/usr/local/lib/python3.6/dist-packages/torch/autograd/grad_mode.py", line 49, in decorate_no_grad
return func(*args, **kwargs)
File "/home/mjz/2D_Detcetion/EESRGAN/detection/engine.py", line 140, in evaluate
coco = get_coco_api_from_dataset(data_loader.dataset)
File "/home/mjz/2D_Detcetion/EESRGAN/detection/coco_utils.py", line 255, in get_coco_api_from_dataset
return convert_to_coco_api(dataset)
File "/home/mjz/2D_Detcetion/EESRGAN/detection/coco_utils.py", line 154, in convert_to_coco_api
img, targets = ds[img_idx]
File "/home/mjz/2D_Detcetion/EESRGAN/scripts_for_datasets/COWC_EESRGAN_FRCNN_dataset.py", line 32, in getitem
img_path_gt = os.path.join(self.data_dir_gt, self.imgs_gt[idx])
IndexError: list index out of range
The text was updated successfully, but these errors were encountered: