Closed ancazugo closed 1 year ago
For the path to be considered absolute it should be preceded with a /
. So in your case "/drive/Shareddrives/detectree2_Cambridge/data/Cambridge/tiles_0.25m_160_20_0_samp"
. We should implement a function that is robust to this though.
The
get_filenames()
function ofdetectree2.models.train
uses glob method to filter the files with a .png extension in the directory given as parameter. The glob method returns the absolute path of all the files. Then, the function usesos.path.join()
to concatenate the directory and the glob result; hence the result is a non-existent path.For instance, if the following chunk is run:
This is the result:
So the path is duplicated, which causes the
predict_on_data()
function to give NULL results because it couldn't read the png files.