yalickj / load-forecasting-resnet

short-term load forecasting with deep residual networks
MIT License
91 stars 31 forks source link

Error while executing the program #8

Closed Aaronng1223 closed 1 year ago

Aaronng1223 commented 1 year ago

Hi, I am newbie to training model using machine learning algorithms. I am using Tensorflow 2.11 and python 3.10 but I got error while I am trying to execute the program. Could you help me to solve the error?

Error typeerror: you are passing kerastensor(type_spec=tensorspec(shape=(), dtype=tf.float32, name=none), name='placeholder:0', description="created by layer 'tf.cast_2'"), an intermediate keras symbolic input/output, to a tf api that does not allow registering custom dispatchers, such as tf.cond, tf.function, gradient tapes, or tf.map_fn. keras functional model construction only supports tf api calls that do support dispatching, such as tf.math.add or tf.reshape. other apis cannot be called directly on symbolic keras inputs/outputs. you can work around this limitation by putting the operation in a custom keras layer call and calling that layer on this symbolic input/output.

yalickj commented 1 year ago

please try disabling eager execution of tensorflow:

from tensorflow.python.framework.ops import disable_eager_execution disable_eager_execution()

Aaronng1223 commented 1 year ago

Disable eager execution inside this program? May I know what is the reason.

yalickj commented 1 year ago

closing as the error has a straight-forward solution.