Skip to content
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

removing solar error #8

Open
ablowe16 opened this issue Jun 8, 2022 · 0 comments
Open

removing solar error #8

ablowe16 opened this issue Jun 8, 2022 · 0 comments

Comments

@ablowe16
Copy link

ablowe16 commented Jun 8, 2022

@jweyn - Great paper and code package. I am trying to use your code for my case using ocean model output (EnKF). I have gone through steps 1 (preprocessing netCDF files) and 2 (remapping to cubed sphere). On step 3 (training), I don't have solar as part of my dataset. Therefore, I have set add_solar=False, but get errors from having a zero dimension.
train_array,input_ind,output_ind,sol = prepare_data_array(train_data,input_sel=io_selection,output_sel=io_selection,add_insolation=False)
sol = None

generator = ArrayDataGenerator(dlwp,train_array,rank=3,input_slice=input_ind, output_slice=output_ind,input_time_steps=io_time_steps, output_time_steps=io_time_steps,sequence=integration_steps, interval=data_interval,insolation_array=sol, batch_size=batch_size,shuffle=shuffle,channels_last=True, drop_remainder=True)

In the generator.generate code:
The remove_nan step, reduces the dimensions of p and t from (1,82944) to (0,82944). Then, it gets caught on the following step

Here is the error message:
Traceback (most recent call last): File "training_DLWP_EnKFmodel.py", line 194, in <module> tf_train_data = tf_data_generator(generator,batch_size=batch_size,input_names=input_names) File "/home/ablowe/DLWP-CS/DLWP/model/generators.py", line 1069, in tf_data_generator p, t = generator.generate([0]) File "/home/ablowe/DLWP-CS/DLWP/model/generators.py", line 961, in generate p = p.reshape((n_sample,) + self.convolution_shape) ValueError: cannot reshape array of size 0 into shape (1,6,6,48,48) Exception ignored in: <function CachingFileManager.__del__ at 0x2b977e8ef680> Traceback (most recent call last): File "/home/ablowe/miniconda3/envs/dlwp/lib/python3.7/site-packages/xarray/backends/file_manager.py", line 244, in __del__ File "/home/ablowe/miniconda3/envs/dlwp/lib/python3.7/site-packages/xarray/backends/file_manager.py", line 218, in close File "/home/ablowe/miniconda3/envs/dlwp/lib/python3.7/contextlib.py", line 239, in helper TypeError: 'NoneType' object is not callable

How do you recommend I fix this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant