I'm running example from TF site and getting different results from CPU and GPU. Results from GPU are obviously wrong (second image). Why?
If I'm executing code with with tf.device('/cpu:0')
then the code works as expected, but slower.
It's sufficient to execute this lines on CPU to fix the issue:
with tf.device('/cpu:0'):
real_output = discriminator(images, training=True)
fake_output = discriminator(generated_images, training=True)
Source code: https://www.tensorflow.org/tutorials/generative/dcgan
My complete results: https://disk.yandex.ru/d/E-hU5dpffOmkLg
Oops, accidentally marked as the answer.
Issue is the same: Calculations on GPU leads to drastically different results compared to CPU. Windows PC with CUDA GPU gives correct result similar to M1 CPU only computation.
Stock prediction source code from: https://www.thepythoncode.com/article/stock-price-prediction-in-python-using-tensorflow-2-and-keras
My implementation and results: https://disk.yandex.ru/d/S0FqJTL582V1Pw
macOs Monterey 12.1, MBA M1 tensorflow-macos 2.7.0 tensorflow-metal 0.3.0
CPU results:
GPU results: