WARNING:tensorflow:sample_weight modes were coerced from ... to [‘...‘]

文章目录

  • 问题
  • 原因
  • 解决

问题

训练代码:
model.fit(graph, y, sample_weight=train_mask, batch_size=NUM, epochs=1, shuffle=False, verbose=0)
出现提示:
WARNING:tensorflow:sample_weight modes were coerced from … to [’…’]
WARNING:tensorflow:sample_weight modes were coerced from ... to [‘...‘]_第1张图片

原因

用的是tensorflow 2.1,2.2版就解决了这个问题

解决

安装tensorflow 2.2
python -m pip install --upgrade pip
pip install tensorflow-cpu==2.2.0 -i https://pypi.douban.com/simple/

你可能感兴趣的:(问题)