栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

python3.5安装tensorflow_python3.8怎么安装tensorflow?

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

python3.5安装tensorflow_python3.8怎么安装tensorflow?

import tensorflow as tf

loss_obj_scc = tf.keras.losses.SparseCategoricalCrossentropy()

使用如下方法直接报出如下问题: 原因是keras版本是2.8版本,可能与tf2.6不兼容,

pip install keras==2.6.0 即可解决

# 2022-03-27 22:41:02.116859: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  AVX AVX2
# To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
# 2022-03-27 22:41:02.338609: E tensorflow/core/lib/monitoring/collection_registry.cc:77] Cannot register 2 metrics with the same name: /tensorflow/api/keras/optimizers
# Traceback (most recent call last):
#   File "C:/Users/yinchen/PycharmProjects/pythonExercise/tensorflow2exercise.py", line 8, in 
#     loss_obj_scc = tf.keras.losses.SparseCategoricalCrossentropy(
#   File "C:anacondaenvspython38baselibsite-packagestensorflowpythonutillazy_loader.py", line 62, in __getattr__
#     module = self._load()
# ......
#   File "C:anacondaenvspython38baselibsite-packagestensorflowpythoneagermonitoring.py", line 135, in __init__
#     self._metric = self._metric_methods[self._label_length].create(*args)
# tensorflow.python.framework.errors_impl.AlreadyExistsError: Another metric with the same name already exists.
#
# Process finished with exit code 1
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/786833.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号