模型结果总是在变化

I'm creating a Keras sequential model with a TensorFlow backend but for some reason, the prediction result are always changing for some objects. I'm using google colab, hence code is separated by cells. I have my imports in a cell above the variable declaration as you can see from the code:

import os
import random as rn
from datetime import datetime as dt
import numpy as np
import keras as ker
import tensorflow as tf

我像这样播种:

seed_val = 1234
os.environ['PYTHONHASHSEED']=str(seed_val)
np.random.seed(seed_val)
tf.random.set_seed(seed_val)
rn.seed(seed_val)

这些是我从这些测试中得到的值都没有改变的值:

enter image description here

评论