Closed ocizvlpuswiubridge closed 4 months ago
Sorry I was late to respond this issue. Did you figure it out? Please let me know if you have further issues.
I also encountered this when training the model on my custom dataset. Are there any solutions to resolve this?
I am fairly sure that has something to do with the dataloading part of the code. I will try to write a few example dataset.py files for common data, but for now you can try to write your own.
Thanks for replying to this issue! Here's more information on the error: I have organized my custom dataset with labels in the proper form (similar to retina dataset you provided). And I wrote my custom dataset class in src/datasets/***.py
, similar to the existing example retina.py
. Than I've got the error as attached figure.
Note that I had added a couple of debug line print("Number of image files:", len(self.imgs))
and print("Number of label files:", len(self.labels))
, according to the output, it seems the function failed to load my custom dataset so the error occurred.
Thanks for your reply, any further suggestions is also appreciated!
Hi De-Yu Guu,
Did you follow the instruction in the main Readme (pasted below)? If you are still having this problem after following the guideline, please shoot me an email (chen.liu.cl2482@yale.edu) and we can try to schedule a debugging session.
Quoting the email from @DerrickGuu:
%%% I wanted to inform you that I managed to resolve the issue I encountered previously. The problem stemmed from mismatched file names between the images and labels in my custom dataset. After renaming the files and restarting the training script, everything worked perfectly!
Regarding the instructions for reproducing the experiment on GitHub, I have a suggestion: it would be helpful to provide more detailed guidance on how to properly prepare the dataset, especially for custom datasets. For instance, specifying that the label format should be saved in npy format could significantly assist other developers and researchers. %%%
I will update the Readme soon.
Hello, when I was training main.py, I encountered this error: 'numpy.exceptions.AxisError: destination: axis 1 is out of bounds for array of dimension 1'
at this line in retina.py: 'self.data_image = np.moveaxis(self.data_image, -1, 1)'. Why would this error occur? And it seems that when I run it in PyCharm, statements like 'sys.path' in the text don't take effect, resulting in errors where many '.py' files from different folders under the same root directory cannot be referenced successfully.