dll-ncai / AI-ForestWatch

MIT License
8 stars 7 forks source link

Arguments not passed to functions #5

Open srinathjayaraman opened 2 years ago

srinathjayaraman commented 2 years ago

In data_loaders.py, line 72, an instance of BaseInferenceDataset is created. BaseInferenceDataset is defined in base_dataset.py. It has the following arguments:

rasterized_shapefiles_path
image_path
stride
bands
model_input_size
district
num_classes
transformation

But when class BaseInferenceDataset is called on line 72 of data_loaders.py, the stride argument is not passed, causing the program to fail. Not sure what value of stride should be passed, but this is clearly an issue that has to be corrected. I've pasted a screenshot from PyCharm showing this error.

error screenshot

A very similar typo is present later on in the same data_loaders.py file. Line 52 creates an instance of BaseTrainDataset, which is also defined in base_dataset.py. It has the following arguments:

data_list
data_map_path
stride
model_input_size
bands
num_classes
one_hot
mode='train'
transforms=None

But when class BaseTrainDataset is called in data_loaders.py, the mode=train argument is not passed (should be mentioned on line 54), which will also cause the program to fail. But on line 59, mode=test is clearly specified under the else condition. This of course means that the missing mode=train argument is just a typo. Should be quite an easy fix. I've created a pull request to fix this.

th145 commented 2 years ago

@srinathjayaraman The original author, Annus has assigned model_input_size to stride. So, in data_loader/data_loader.py, assign stride=model_input_size before bands and it should work fine.

srinathjayaraman commented 2 years ago

Thank you!!

srinathjayaraman commented 2 years ago

@srinathjayaraman The original author, Annus has assigned model_input_size to stride.

Where did you notice this @th145?

th145 commented 2 years ago

@srinathjayaraman In his repo! :P Old code is his code.