George has to fix the error which curiously occurs when passing from vae_learn1.py to vae_learn2.py
"Traceback (most recent call last):
File "/ClimateDynamics/MediumSpace/ClimateLearningFR/gmiloshe/VAE/vae_learn2.py", line 274, in
X, LON, LAT, vae, Z_DIM, N_EPOCHS, INITIAL_EPOCH, BATCH_SIZE, LEARNING_RATE, checkpoint_path, checkpoint_name, myinput, history = PrepareDataAndVAE()
File "/ClimateDynamics/MediumSpace/ClimateLearningFR/gmiloshe/VAE/vae_learn2.py", line 259, in PrepareDataAndVAE
vae, history, N_EPOCHS, INITIAL_EPOCH, checkpoint, checkpoint_path = ConstructVAE(INPUT_DIM, Z_DIM, checkpoint_name, N_EPOCHS, myinput, K1, K2, from_logits=False, mask_weights=filter_mask)
File "/ClimateDynamics/MediumSpace/ClimateLearningFR/gmiloshe/VAE/vae_learn2.py", line 169, in ConstructVAE
decoder_input, decoder_output, decoder = tff.build_decoder_skip(input_dim = 64,
File "/ClimateDynamics/MediumSpace/ClimateLearningFR/gmiloshe/ERA/TF_Fields.py", line 287, in build_decoder_skip
decoder_outputs = ConstMul(mask,(~mask)*0.5)(x[-1]) # This will multiply the input by mask consisting of 0's (False) and 1's (True). Because the decoder is expected to reconstruct sigmoid function we add 0.5 where there were 0's
File "/home/gmiloshe/miniconda3/envs/myenvnew/lib/python3.9/site-packages/tensorflow/python/keras/engine/base_layer.py", line 951, in call
return self._functional_construction_call(inputs, args, kwargs,
File "/home/gmiloshe/miniconda3/envs/myenvnew/lib/python3.9/site-packages/tensorflow/python/keras/engine/base_layer.py", line 1090, in _functional_construction_call
outputs = self._keras_tensor_symbolic_call(
File "/home/gmiloshe/miniconda3/envs/myenvnew/lib/python3.9/site-packages/tensorflow/python/keras/engine/base_layer.py", line 822, in _keras_tensor_symbolic_call
return self._infer_output_signature(inputs, args, kwargs, input_masks)
File "/home/gmiloshe/miniconda3/envs/myenvnew/lib/python3.9/site-packages/tensorflow/python/keras/engine/base_layer.py", line 863, in _infer_output_signature
outputs = call_fn(inputs, *args, **kwargs)
File "/home/gmiloshe/miniconda3/envs/myenvnew/lib/python3.9/site-packages/tensorflow/python/autograph/impl/api.py", line 670, in wrapper
raise e.ag_error_metadata.to_exception(e)
NotImplementedError: in user code:
/ClimateDynamics/MediumSpace/ClimateLearningFR/gmiloshe/ERA/TF_Fields.py:49 call *
return inputs * self.const_a + self.const_b
/home/gmiloshe/miniconda3/envs/myenvnew/lib/python3.9/site-packages/tensorflow/python/ops/math_ops.py:1175 binary_op_wrapper
out = r_op(x)
/home/gmiloshe/miniconda3/envs/myenvnew/lib/python3.9/site-packages/tensorflow/python/framework/ops.py:852 __array__
raise NotImplementedError(
NotImplementedError: Cannot convert a symbolic Tensor (Placeholder:0) to a numpy array. This error may indicate that you're trying to pass a Tensor to a NumPy call, which is not supported
"