You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>This type of error occurs due to the incompatible dependencies version of the device. There is a bug in Keras/TensorFlow 2.9 and 2.10, which causes preprocess layers like rescaling to be extremely slow. You can try the model without the rescaling layer. If you want to use this or similar preprocessing layers, you should use TF version 2.8.3 or older. It seems that some problem with the wrong version of TensorFlow/Keras/cuda.<br><p>Choose one stable version, and try again. Many times, the rescaling method occurs in error. If you want to use the rescaling method, then try this class instead of using the rescaling function from Keras. </p><pre class="max-w-full rounded-md w-full"><code class="language-python">class Rescaling(tf.keras.layers.Layer): <br> """Multiply inputs by `scale` and adds `offset`. For instance: 1. To rescale an input in the `[0, 255]` range to be in the `[0, 1]` range,<br> you would pass `scale=1./255`. 2. To rescale an input in the `[0, 255]` range to be in the `[-1, 1]` range, <br>you would pass `scale=1./127.5, offset=-1`. The rescaling is applied both during training and inference. <br>Input shape:Arbitrary. Output shape:Same as input. Arguments: scale: Float, the scale to apply to the inputs. offset: Float, the offset to apply to the inputs. name: A string, the name of the layer. """ <br> def __init__(self, scale, offset=0., name=None, **kwargs): <br> self.scale = scale <br> self.offset = offset <br> super(Rescaling, self).__init__(name=name, **kwargs) <br> def call(self, inputs): <br> dtype = self._compute_dtype <br> scale = tf.cast(self.scale, type) <br> offset = tf.cast(self.offset, type) <br> return tf.cast(inputs, dtype) * scale + offset <br> def compute_output_shape(self, input_shape): <br> return input_shape<br> def get_config(self): <br> config = { 'scale': self.scale, 'offset': self.offset, } <br> base_config = super(Rescaling, self).get_config()<br> return dict(list(base_config.items()) + list(config.items()))
</code></pre><p>You can also notice the preprocessing layers that are used for augmentation purposes. If the problem still remains, then ask the TensorFlow forum or the community. In summary, when you face issues with TensorFlow, Keras then be aware of potential bugs and compatibility concerns. Choose the right version of the libraries. If a Rescaling layer is used then use the custom "Rescaling" layer. Ensure a smoother and more efficient deep learning workflow.</p></p>
How do you think I could fix the problem?
The text was updated successfully, but these errors were encountered:
I have set up
Highlighterjs
with myNextJS@13+
page routing, but the code block is taking single line with scroll-x. Look at the image...The text was updated successfully, but these errors were encountered: