mhpi / hydroDL

Other
183 stars 98 forks source link

FileNotFoundError #8

Closed senlintz closed 7 months ago

senlintz commented 2 years ago

'2.Train LSTM and CNN-LSTM models for prediction in ungauged regions The dataset used is also NCAR CAMELS. Follow the instructions in the first example above to download and unzip the dataset. Use this code to test your saved models after training finished.'

When I run that code, it showed me: FileNotFoundError: [Errno 2] No such file or directory: '\data\rnnStreamflow\PUR\Testrun\samp103Lst.json' How can I get samp103Lst.json? I don't even find the file named rnnStreamflow.

Thank you for your answer! (I downloaded all the zip but I can't run envn one code...)

chaopengshen commented 2 years ago

@dpfeng201 please take a look

dpfeng201 commented 2 years ago

Hi, did you first run the training code to train LSTM PUR models on CAMELS? The training code is here (by clicking the title of each example): hydroDL/example/PUR/trainPUR-Reg.py In this code, you define where to save your trained models in line 52 and line70-72. Only after you train the model, you can use this testing code to test your saved models: hydroDL/example/PUR/testPUR-Reg.py This file samp103Lst.json should be automatically generated in the testing code and saved to the directory of your trained models, as shown in line 112 to 120. Line 34 to 41 defines where you saved your model previously in training and these saved models would be tested now.