-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"RuntimeError: NetCDF: Not a valid ID" error when generating samples from dataloader #183
Comments
Getting same error when running via the icenet-pipeline: $ ./run_predict_ensemble.sh -f 0.6 -p bashpc.sh tutorial_south_ensemble tutorial_pipeline_south tutorial_south_ensemble_forecast testdates.csv
WARNING:root:./results/predict/tutorial_south_ensemble_forecast/tutorial_south_ensemble.42 output already exists
WARNING:root:./results/predict/tutorial_south_ensemble_forecast/tutorial_south_ensemble.42 output already exists
Traceback (most recent call last):
File "/data/hpcdata/users/username/miniconda3/envs/icenet0.2.8/lib/python3.11/site-packages/xarray/backends/api.py", line 1026, in open_mfdataset
combined = combine_by_coords(
^^^^^^^^^^^^^^^^^^
File "/data/hpcdata/users/username/miniconda3/envs/icenet0.2.8/lib/python3.11/site-packages/xarray/core/combine.py", line 982, in combine_by_coords
concatenated = _combine_single_variable_hypercube(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/data/hpcdata/users/username/miniconda3/envs/icenet0.2.8/lib/python3.11/site-packages/xarray/core/combine.py", line 629, in _combine_single_variable_hypercube
combined_ids, concat_dims = _infer_concat_order_from_coords(list(datasets))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/data/hpcdata/users/username/miniconda3/envs/icenet0.2.8/lib/python3.11/site-packages/xarray/core/combine.py", line 149, in _infer_concat_order_from_coords
raise ValueError(
ValueError: Could not find any dimension coordinates to use to order the datasets for concatenation
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/data/hpcdata/users/username/miniconda3/envs/icenet0.2.8/bin/icenet_predict", line 33, in <module>
sys.exit(load_entry_point('icenet', 'console_scripts', 'icenet_predict')())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/data/hpcdata/users/username/git/icenet/icenet/icenet/model/predict.py", line 203, in main
predict_forecast(
File "/data/hpcdata/users/username/git/icenet/icenet/icenet/model/predict.py", line 75, in predict_forecast
data_sample = dl.generate_sample(date, prediction=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/data/hpcdata/users/username/git/icenet/icenet/icenet/data/loaders/dask.py", line 263, in generate_sample
var_ds = xr.open_mfdataset([
^^^^^^^^^^^^^^^^^^^
File "/data/hpcdata/users/username/miniconda3/envs/icenet0.2.8/lib/python3.11/site-packages/xarray/backends/api.py", line 1041, in open_mfdataset
ds.close()
File "/data/hpcdata/users/username/miniconda3/envs/icenet0.2.8/lib/python3.11/site-packages/xarray/core/common.py", line 1155, in close
self._close()
File "/data/hpcdata/users/username/miniconda3/envs/icenet0.2.8/lib/python3.11/site-packages/xarray/backends/netCDF4_.py", line 513, in close
self._manager.close(**kwargs)
File "/data/hpcdata/users/username/miniconda3/envs/icenet0.2.8/lib/python3.11/site-packages/xarray/backends/file_manager.py", line 232, in close
file.close()
File "src/netCDF4/_netCDF4.pyx", line 2627, in netCDF4._netCDF4.Dataset.close
File "src/netCDF4/_netCDF4.pyx", line 2590, in netCDF4._netCDF4.Dataset._close
File "src/netCDF4/_netCDF4.pyx", line 2034, in netCDF4._netCDF4._ensure_nc_success
RuntimeError: NetCDF: Not a valid ID Relates to pydata/xarray#7079 ResolutionSome of the fixes mention involve:
|
This is one of two things, but my memory is failing me (still drinking morning coffee): usually this means there is some gunky data, usually in SIC. Worth checking that you have all the data you need to generate the complete set, or try a different date, to ensure the issue is not library based. |
Currently working on PyTorch example implementation here, but come across an error when generating samples from the dataloader (via
DaskMultiWorkerLoader.generate_sample
).I've created a IceNet dataset which inherits from the
torch.Dataset
class here. And when iterating through the dataset, I come across the following error:At what point this error occurs is quite volatile. This is an issue during training when we're obtaining samples at each epoch.
The training will fail at different points at each run so it's been difficult to really nail down the issue, but we suspect its from the multiprocessing.
The text was updated successfully, but these errors were encountered: