gee-community/geemap

File not found, no such file or directory when download confusion matrix step

mega12345678 opened this issue · 2 comments

Everything is ok until the step to download confusion matrix, there is error. The error is like this :
FileNotFoundError Traceback (most recent call last)
in <cell line: 8>()
6 testing_csv = os.path.join(out_dir, 'test_accuracy.csv')
7
----> 8 with open(training_csv, "w", newline="") as f:
9 writer = csv.writer(f)
10 writer.writerows(train_accuracy.getInfo())

FileNotFoundError: [Errno 2] No such file or directory: '/root/Downloads/train_accuracy.csv'
So, what is wrong?

giswqs commented

If you are using Colab, you can use the current working directory rather than the root directory.

out_dir = os.getcwd()
testing_csv = os.path.join(out_dir, 'test_accuracy.csv')

Great. Thank you. It is work