使用Keras找不到tensorflow 20C

程序代码
#-*- coding: utf-8 -*-
#使用神经网络算法预测销量高低

import pandas as pd

#参数初始化
inputfile = 'D:/python/chapter5/demo/data/sales_data.xls'
data = pd.read_excel(inputfile, index_col = u'序号') #导入数据

#数据是类别标签,要将它转换为数据
#用1来表示“好”、“是”、“高”这三个属性,用0来表示“坏”、“否”、“低”
data[data == u'好'] = 1
data[data == u'是'] = 1
data[data == u'高'] = 1
data[data != 1] = 0
x = data.iloc[:,:3].as_matrix().astype(int)
y = data.iloc[:,3].as_matrix().astype(int)

from keras.models import Sequential
from keras.layers.core import Dense, Activation

model = Sequential() #建立模型
model.add(Dense(input_dim = 3, output_dim = 10))
model.add(Activation('relu')) #用relu函数作为激活函数,能够大幅提供准确度
model.add(Dense(input_dim = 10, output_dim = 1))
model.add(Activation('sigmoid')) #由于是0-1输出,用sigmoid函数作为激活函数

model.compile(loss = 'binary_crossentropy', optimizer = 'adam', class_mode = 'binary')
#编译模型。由于我们做的是二元分类,所以我们指定损失函数为binary_crossentropy,以及模式为binary
#另外常见的损失函数还有mean_squared_error、categorical_crossentropy等,请阅读帮助文件。
#求解方法我们指定用adam,还有sgd、rmsprop等可选

model.fit(x, y, nb_epoch = 1000, batch_size = 10) #训练模型,学习一千次
yp = model.predict_classes(x).reshape(len(y)) #分类预测

from cm_plot import * #导入自行编写的混淆矩阵可视化函数
cm_plot(y,yp).show() #显示混淆矩阵可视化结果

错误提示
Using TensorFlow backend.

Traceback (most recent call last):
File "D:\python\chapter5\demo\code\5-3_neural_network.py", line 19, in
from keras.models import Sequential
File "C:\Python27\lib\site-packages\keras__init__.py", line 3, in
from . import utils
File "C:\Python27\lib\site-packages\keras\utils__init__.py", line 6, in
from . import conv_utils
File "C:\Python27\lib\site-packages\keras\utils\conv_utils.py", line 3, in
from .. import backend as K
File "C:\Python27\lib\site-packages\keras\backend__init__.py", line 83, in
from .tensorflow_backend import *
File "C:\Python27\lib\site-packages\keras\backend\tensorflow_backend.py", line 1, in
import tensorflow as tf
ImportError: No module named tensorflow

2个回答

你要调用TensorFlow,必须要安装它,这样keras才能正常使用

TensorFlow没有安装吧

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
Tensorflow代码转到Keras

我现在有Tensortflow的代码和结构图如下,这是AC-GAN中生成器的部分,我用原生tf是可以跑通的,但当我想转到Keras中实现却很头疼。 ``` def batch_norm(inputs, is_training=is_training, decay=0.9): return tf.contrib.layers.batch_norm(inputs, is_training=is_training, decay=decay) # 构建残差块 def g_block(inputs): h0 = tf.nn.relu(batch_norm(conv2d(inputs, 3, 64, 1, use_bias=False))) h0 = batch_norm(conv2d(h0, 3, 64, 1, use_bias=False)) h0 = tf.add(h0, inputs) return h0 # 生成器 # batch_size = 32 # z : shape(32, 128) # label : shape(32, 34) def generator(z, label): with tf.variable_scope('generator', reuse=None): d = 16 z = tf.concat([z, label], axis=1) h0 = tf.layers.dense(z, units=d * d * 64) h0 = tf.reshape(h0, shape=[-1, d, d, 64]) h0 = tf.nn.relu(batch_norm(h0)) shortcut = h0 for i in range(16): h0 = g_block(h0) h0 = tf.nn.relu(batch_norm(h0)) h0 = tf.add(h0, shortcut) for i in range(3): h0 = conv2d(h0, 3, 256, 1, use_bias=False) h0 = tf.depth_to_space(h0, 2) h0 = tf.nn.relu(batch_norm(h0)) h0 = tf.layers.conv2d(h0, kernel_size=9, filters=3, strides=1, padding='same', activation=tf.nn.tanh, name='g', use_bias=True) return h0 ``` ![生成器结构图](https://img-ask.csdn.net/upload/201910/29/1572278934_997142.png) 在Keras中都是先构建Model,在Model中不断的加层 但上面的代码却是中间包含着新旧数据的计算,比如 ``` .... shortcut = h0 .... h0 = tf.add(h0, shortcut) ``` 难不成我还要构建另外一个model作为中间输出吗? 大佬们帮帮忙解释下,或者能不能给出翻译到Keras中应该怎么写

python3.7中的tensorflow2.0模块没有的问题。

小白刚做手写字识别,遇到tensorflow导入模块的一些问题,模块ModuleNotFoundError: No module named 'tensorflow.examples.tutorials'不会解决。 import keras # 导入Keras import numpy as np from keras.datasets import mnist # 从keras中导入mnist数据集 from keras.models import Sequential # 导入序贯模型 from keras.layers import Dense # 导入全连接层 from keras.optimizers import SGD # 导入优化函数 from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets("MNIST_data", one_hot = True) ![图片说明](https://img-ask.csdn.net/upload/201911/17/1573957701_315782.png) 在网上找了好久,也不怎么懂,能告诉我详实点的解决办法。

TensorFlow不能导入python的问题

Python版本2.7.13.下好tensorflow之后Import tensorflow as tf 失败了!![图片说明](https://img-ask.csdn.net/upload/201707/14/1499994613_742213.png)求大神解答一下啊!

pip install keras 出现问题

看不懂…求解![图片](https://img-ask.csdn.net/upload/201711/06/1509975346_181543.png)

请问tensorflow中程序运行完如何释放显存

在网上没检索到相关的代码。 已经掌握按比例/按需显存管理,现在想让模型在运行结束后自动释放显存,qing'wen'you'shen'me'ban'fa

TensorFlow2.0训练模型时,指标不收敛一直上升到1

我尝试着使用tf2.0来搭建一个DeepFM模型来预测用户是否喜欢某部影片, optimizer选择Adam,loss选择BinaryCrossentropy,评价指标是AUC; 因为涉及到了影片ID,所以我用了shared_embedding,并且必须关闭eager模式; 选用binary_crossentropy作为损失函数时模型在训练时AUC很快就到1了,但选用categorical_crossentropy时loss没太大变化,并且AUC一直保持在0.5,准确率也一直在0.5附近震荡。 下面是选用binary_crossentropy时的输出日志: ![图片说明](https://img-ask.csdn.net/upload/202002/21/1582271521_157835.png) ![图片说明](https://img-ask.csdn.net/upload/202002/21/1582271561_279055.png) 下面是我的代码: ``` one_order_feature_layer = tf.keras.layers.DenseFeatures(one_order_feature_columns) one_order_feature_layer_outputs = one_order_feature_layer(feature_layer_inputs) two_order_feature_layer = tf.keras.layers.DenseFeatures(two_order_feature_columns) two_order_feature_layer_outputs = two_order_feature_layer(feature_layer_inputs) # lr部分 lr_layer = tf.keras.layers.Dense(len(one_order_feature_columns), kernel_initializer=initializer)( one_order_feature_layer_outputs) # fm部分 reshape = tf.reshape(two_order_feature_layer_outputs, [-1, len(two_order_feature_columns), two_order_feature_columns[0].dimension]) sum_square = tf.square(tf.reduce_sum(reshape, axis=1)) square_sum = tf.reduce_sum(tf.square(reshape), axis=1) fm_layers = tf.multiply(0.5, tf.subtract(sum_square, square_sum)) # DNN部分 dnn_hidden_layer_1 = tf.keras.layers.Dense(64, activation='selu', kernel_initializer=initializer, kernel_regularizer=regularizer)(two_order_feature_layer_outputs) dnn_hidden_layer_2 = tf.keras.layers.Dense(64, activation='selu', kernel_initializer=initializer, kernel_regularizer=regularizer)(dnn_hidden_layer_1) dnn_hidden_layer_3 = tf.keras.layers.Dense(64, activation='selu', kernel_initializer=initializer, kernel_regularizer=regularizer)(dnn_hidden_layer_2) dnn_dropout = tf.keras.layers.Dropout(0.5, seed=29)(dnn_hidden_layer_3) # 连接并输出 concatenate_layer = tf.keras.layers.concatenate([lr_layer, fm_layers, dnn_dropout]) out_layer = tf.keras.layers.Dense(1, activation='sigmoid')(concatenate_layer) model = tf.keras.Model(inputs=[v for v in feature_layer_inputs.values()], outputs=out_layer) model.compile(optimizer=tf.keras.optimizers.Adam(learning_rate=learning_rate), loss=tf.keras.losses.BinaryCrossentropy(), metrics=['AUC']) # tf.keras.utils.plot_model(model, 'test.png', show_shapes=True) train_ds = make_dataset(train_df, buffer_size=None, shuffle=True) test_ds = make_dataset(test_df) with tf.compat.v1.Session() as sess: sess.run([tf.compat.v1.global_variables_initializer(), tf.compat.v1.tables_initializer()]) model.fit(train_ds, epochs=5) loss, auc = model.evaluate(test_ds) print("AUC", auc) ```

Anaconda3+python3.7 +TensorFlow 2.1,安装成功,但是在IDLE和pycharm中引入出现如下错误,请问如何才能解决?

Traceback (most recent call last): File "F:\Anaconda\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in <module> from tensorflow.python.pywrap_tensorflow_internal import * File "F:\Anaconda\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in <module> _pywrap_tensorflow_internal = swig_import_helper() File "F:\Anaconda\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description) File "F:\Anaconda\lib\imp.py", line 242, in load_module return load_dynamic(name, filename, file) File "F:\Anaconda\lib\imp.py", line 342, in load_dynamic return _load(spec) ImportError: DLL load failed: 找不到指定的模块。 During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<pyshell#0>", line 1, in <module> import tensorflow File "F:\Anaconda\lib\site-packages\tensorflow\__init__.py", line 101, in <module> from tensorflow_core import * File "F:\Anaconda\lib\site-packages\tensorflow_core\__init__.py", line 40, in <module> from tensorflow.python.tools import module_util as _module_util File "F:\Anaconda\lib\site-packages\tensorflow\__init__.py", line 50, in __getattr__ module = self._load() File "F:\Anaconda\lib\site-packages\tensorflow\__init__.py", line 44, in _load module = _importlib.import_module(self.__name__) File "F:\Anaconda\lib\importlib\__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "F:\Anaconda\lib\site-packages\tensorflow_core\python\__init__.py", line 49, in <module> from tensorflow.python import pywrap_tensorflow File "F:\Anaconda\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 74, in <module> raise ImportError(msg) ImportError: Traceback (most recent call last): File "F:\Anaconda\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in <module> from tensorflow.python.pywrap_tensorflow_internal import * File "F:\Anaconda\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in <module> _pywrap_tensorflow_internal = swig_import_helper() File "F:\Anaconda\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description) File "F:\Anaconda\lib\imp.py", line 242, in load_module return load_dynamic(name, filename, file) File "F:\Anaconda\lib\imp.py", line 342, in load_dynamic return _load(spec) ImportError: DLL load failed: 找不到指定的模块。 Failed to load the native TensorFlow runtime. See https://www.tensorflow.org/install/errors for some common reasons and solutions. Include the entire stack trace above this error message when asking for help.

tensorflow中相同函数问题

在tensorflow示例程序中看到这样一个代码 >>import tensorflow as tf >>from tensorflow.python.framework import ops >>ops.reset\_default_graph() 不知道这个函数是否和下面一个函数一样 >>tf.reset\_default_graph() 如果不一样,两个有什么不同?用哪一个更好? 如果这两个函数都是相同的,他们是重新写了一遍?还是都用tensorflow中同一个函数?

tensorflow 的gpu利用率很低

1.使用tensorflow训练fcn网络,训练速度很慢,使用tensorboard查看了fcn的图,显示全部都是在gpu上,但是gpu利用率一直是30%多,没有超过40%。 2。我使用的batchsize是1,gpu利用率一直都是30多,若修改为其他比较大的数据,例如128,gpu利用率可以达到60%多,但是仍然无法达到90%。 这是为什么?怎么会这样呢?

为什么我使用TensorFlow2.0训练的时候loss的变化那么奇怪?

我使用tf2.0搭建了一个deepfm模型用来做一个二分类预测。 训练过程中train loss一直在下降,val loss却一直在上升,并且训练到一半内存就不够用了,这是怎么一回事? ``` Train on 19532 steps, validate on 977 steps Epoch 1/5 19532/19532 [==============================] - 549s 28ms/step - loss: 0.4660 - AUC: 0.8519 - val_loss: 1.0059 - val_AUC: 0.5829 Epoch 2/5 19532/19532 [==============================] - 522s 27ms/step - loss: 0.1861 - AUC: 0.9787 - val_loss: 1.7618 - val_AUC: 0.5590 Epoch 3/5 17150/19532 [=========================>....] - ETA: 1:06 - loss: 0.0877 - AUC: 0.9951 Process finished with exit code 137 ``` 还有个问题,我在设计过程中关闭了eager模式,必须使用了下面代码进行初始化: ``` sess.run([tf.compat.v1.global_variables_initializer(), tf.compat.v1.tables_initializer()]) ``` 但我的代码中使用了其他的初始化方法: ``` initializer = tf.keras.initializers.TruncatedNormal(stddev=stddev, seed=29) regularizer = tf.keras.regularizers.l2(l2_reg) .... dnn_hidden_layer_3 = tf.keras.layers.Dense(64, activation='selu', kernel_initializer=initializer, kernel_regularizer=regularizer)(dnn_hidden_layer_2) .... ``` 我这样做他还是按我定义的初始化方法那样初始化吗? 本人小白,在这里先跪谢大家了!

求问大佬装TensorFlow出现这样的情况是怎么办呀

(TF2.1) C:\Users\lenovo>pip install tensorflow==2.1 Requirement already satisfied: tensorflow==2.1 in f:\anaconda3\envs\tf2.1\lib\site-packages (2.1.0) Requirement already satisfied: termcolor>=1.1.0 in f:\anaconda3\envs\tf2.1\lib\site-packages (from tensorflow==2.1) (1.1.0) Requirement already satisfied: protobuf>=3.8.0 in f:\anaconda3\envs\tf2.1\lib\site-packages (from tensorflow==2.1) (3.11.3) Requirement already satisfied: absl-py>=0.7.0 in f:\anaconda3\envs\tf2.1\lib\site-packages (from tensorflow==2.1) (0.9.0) Requirement already satisfied: opt-einsum>=2.3.2 in f:\anaconda3\envs\tf2.1\lib\site-packages (from tensorflow==2.1) (3.2.1) Requirement already satisfied: google-pasta>=0.1.6 in f:\anaconda3\envs\tf2.1\lib\site-packages (from tensorflow==2.1) (0.2.0) Requirement already satisfied: wheel>=0.26; python_version >= "3" in f:\anaconda3\envs\tf2.1\lib\site-packages (from tensorflow==2.1) (0.34.2) Requirement already satisfied: wrapt>=1.11.1 in f:\anaconda3\envs\tf2.1\lib\site-packages (from tensorflow==2.1) (1.12.1) Requirement already satisfied: gast==0.2.2 in f:\anaconda3\envs\tf2.1\lib\site-packages (from tensorflow==2.1) (0.2.2) Requirement already satisfied: six>=1.12.0 in f:\anaconda3\envs\tf2.1\lib\site-packages (from tensorflow==2.1) (1.14.0) Requirement already satisfied: numpy<2.0,>=1.16.0 in f:\anaconda3\envs\tf2.1\lib\site-packages (from tensorflow==2.1) (1.18.4) Requirement already satisfied: tensorboard<2.2.0,>=2.1.0 in f:\anaconda3\envs\tf2.1\lib\site-packages (from tensorflow==2.1) (2.1.1) Requirement already satisfied: tensorflow-estimator<2.2.0,>=2.1.0rc0 in f:\anaconda3\envs\tf2.1\lib\site-packages (from tensorflow==2.1) (2.1.0) Requirement already satisfied: grpcio>=1.8.6 in f:\anaconda3\envs\tf2.1\lib\site-packages (from tensorflow==2.1) (1.28.1) Requirement already satisfied: astor>=0.6.0 in f:\anaconda3\envs\tf2.1\lib\site-packages (from tensorflow==2.1) (0.8.1) Requirement already satisfied: scipy==1.4.1; python_version >= "3" in f:\anaconda3\envs\tf2.1\lib\site-packages (from tensorflow==2.1) (1.4.1) Requirement already satisfied: keras-applications>=1.0.8 in f:\anaconda3\envs\tf2.1\lib\site-packages (from tensorflow==2.1) (1.0.8) Requirement already satisfied: keras-preprocessing>=1.1.0 in f:\anaconda3\envs\tf2.1\lib\site-packages (from tensorflow==2.1) (1.1.0) Requirement already satisfied: setuptools in f:\anaconda3\envs\tf2.1\lib\site-packages (from protobuf>=3.8.0->tensorflow==2.1) (46.1.3.post20200330) Requirement already satisfied: markdown>=2.6.8 in f:\anaconda3\envs\tf2.1\lib\site-packages (from tensorboard<2.2.0,>=2.1.0->tensorflow==2.1) (3.2.1) Requirement already satisfied: google-auth<2,>=1.6.3 in f:\anaconda3\envs\tf2.1\lib\site-packages (from tensorboard<2.2.0,>=2.1.0->tensorflow==2.1) (1.14.1) Requirement already satisfied: google-auth-oauthlib<0.5,>=0.4.1 in f:\anaconda3\envs\tf2.1\lib\site-packages (from tensorboard<2.2.0,>=2.1.0->tensorflow==2.1) (0.4.1) Requirement already satisfied: werkzeug>=0.11.15 in f:\anaconda3\envs\tf2.1\lib\site-packages (from tensorboard<2.2.0,>=2.1.0->tensorflow==2.1) (1.0.1) Requirement already satisfied: requests<3,>=2.21.0 in f:\anaconda3\envs\tf2.1\lib\site-packages (from tensorboard<2.2.0,>=2.1.0->tensorflow==2.1) (2.23.0) Requirement already satisfied: h5py in f:\anaconda3\envs\tf2.1\lib\site-packages (from keras-applications>=1.0.8->tensorflow==2.1) (2.10.0) Requirement already satisfied: pyasn1-modules>=0.2.1 in f:\anaconda3\envs\tf2.1\lib\site-packages (from google-auth<2,>=1.6.3->tensorboard<2.2.0,>=2.1.0->tensorflow==2.1) (0.2.8) Requirement already satisfied: rsa<4.1,>=3.1.4 in f:\anaconda3\envs\tf2.1\lib\site-packages (from google-auth<2,>=1.6.3->tensorboard<2.2.0,>=2.1.0->tensorflow==2.1) (4.0) Requirement already satisfied: cachetools<5.0,>=2.0.0 in f:\anaconda3\envs\tf2.1\lib\site-packages (from google-auth<2,>=1.6.3->tensorboard<2.2.0,>=2.1.0->tensorflow==2.1) (4.1.0) Requirement already satisfied: requests-oauthlib>=0.7.0 in f:\anaconda3\envs\tf2.1\lib\site-packages (from google-auth-oauthlib<0.5,>=0.4.1->tensorboard<2.2.0,>=2.1.0->tensorflow==2.1) (1.3.0) Requirement already satisfied: chardet<4,>=3.0.2 in f:\anaconda3\envs\tf2.1\lib\site-packages (from requests<3,>=2.21.0->tensorboard<2.2.0,>=2.1.0->tensorflow==2.1) (3.0.4) Requirement already satisfied: idna<3,>=2.5 in f:\anaconda3\envs\tf2.1\lib\site-packages (from requests<3,>=2.21.0->tensorboard<2.2.0,>=2.1.0->tensorflow==2.1) (2.9) Requirement already satisfied: certifi>=2017.4.17 in f:\anaconda3\envs\tf2.1\lib\site-packages (from requests<3,>=2.21.0->tensorboard<2.2.0,>=2.1.0->tensorflow==2.1) (2020.4.5.1) Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in f:\anaconda3\envs\tf2.1\lib\site-packages (from requests<3,>=2.21.0->tensorboard<2.2.0,>=2.1.0->tensorflow==2.1) (1.25.9) Requirement already satisfied: pyasn1<0.5.0,>=0.4.6 in f:\anaconda3\envs\tf2.1\lib\site-packages (from pyasn1-modules>=0.2.1->google-auth<2,>=1.6.3->tensorboard<2.2.0,>=2.1.0->tensorflow==2.1) (0.4.8) Requirement already satisfied: oauthlib>=3.0.0 in f:\anaconda3\envs\tf2.1\lib\site-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<0.5,>=0.4.1->tensorboard<2.2.0,>=2.1.0->tensorflow==2.1) (3.1.0) (TF2.1) C:\Users\lenovo>python Python 3.7.7 (default, Apr 15 2020, 05:09:04) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import tensorflow as tf Traceback (most recent call last): File "F:\anaconda3\envs\TF2.1\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in <module> from tensorflow.python.pywrap_tensorflow_internal import * File "F:\anaconda3\envs\TF2.1\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in <module> _pywrap_tensorflow_internal = swig_import_helper() File "F:\anaconda3\envs\TF2.1\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description) File "F:\anaconda3\envs\TF2.1\lib\imp.py", line 242, in load_module return load_dynamic(name, filename, file) File "F:\anaconda3\envs\TF2.1\lib\imp.py", line 342, in load_dynamic return _load(spec) ImportError: DLL load failed: 找不到指定的模块。 During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "F:\anaconda3\envs\TF2.1\lib\site-packages\tensorflow\__init__.py", line 101, in <module> from tensorflow_core import * File "F:\anaconda3\envs\TF2.1\lib\site-packages\tensorflow_core\__init__.py", line 40, in <module> from tensorflow.python.tools import module_util as _module_util File "F:\anaconda3\envs\TF2.1\lib\site-packages\tensorflow\__init__.py", line 50, in __getattr__ module = self._load() File "F:\anaconda3\envs\TF2.1\lib\site-packages\tensorflow\__init__.py", line 44, in _load module = _importlib.import_module(self.__name__) File "F:\anaconda3\envs\TF2.1\lib\importlib\__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "F:\anaconda3\envs\TF2.1\lib\site-packages\tensorflow_core\python\__init__.py", line 49, in <module> from tensorflow.python import pywrap_tensorflow File "F:\anaconda3\envs\TF2.1\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 74, in <module> raise ImportError(msg) ImportError: Traceback (most recent call last): File "F:\anaconda3\envs\TF2.1\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in <module> from tensorflow.python.pywrap_tensorflow_internal import * File "F:\anaconda3\envs\TF2.1\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in <module> _pywrap_tensorflow_internal = swig_import_helper() File "F:\anaconda3\envs\TF2.1\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description) File "F:\anaconda3\envs\TF2.1\lib\imp.py", line 242, in load_module return load_dynamic(name, filename, file) File "F:\anaconda3\envs\TF2.1\lib\imp.py", line 342, in load_dynamic return _load(spec) ImportError: DLL load failed: 找不到指定的模块。 Failed to load the native TensorFlow runtime. See https://www.tensorflow.org/install/errors for some common reasons and solutions. Include the entire stack trace above this error message when asking for help.

Tensorflow-gpu 显存不会自动释放?

在jupyter上跑with tf.Session() as sess语句结束后,电脑变得很卡,打开任务管理器 显存占用3.2G,点了restart显存才能释放,我显存4G的,这是什么原因?为什么教学视频中用cpu 没这个问题

keras 训练网络时出现ValueError

rt 使用keras中的model.fit函数进行训练时出现错误:ValueError: None values not supported. 错误信息如下: ``` File "C:/Users/Desktop/MNISTpractice/mnist.py", line 93, in <module> model.fit(x_train,y_train, epochs=2, callbacks=callback_list,validation_data=(x_val,y_val)) File "C:\Anaconda3\lib\site-packages\keras\engine\training.py", line 1575, in fit self._make_train_function() File "C:\Anaconda3\lib\site-packages\keras\engine\training.py", line 960, in _make_train_function loss=self.total_loss) File "C:\Anaconda3\lib\site-packages\keras\legacy\interfaces.py", line 87, in wrapper return func(*args, **kwargs) File "C:\Anaconda3\lib\site-packages\keras\optimizers.py", line 432, in get_updates m_t = (self.beta_1 * m) + (1. - self.beta_1) * g File "C:\Anaconda3\lib\site-packages\tensorflow\python\ops\math_ops.py", line 820, in binary_op_wrapper y = ops.convert_to_tensor(y, dtype=x.dtype.base_dtype, name="y") File "C:\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 639, in convert_to_tensor as_ref=False) File "C:\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 704, in internal_convert_to_tensor ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref) File "C:\Anaconda3\lib\site-packages\tensorflow\python\framework\constant_op.py", line 113, in _constant_tensor_conversion_function return constant(v, dtype=dtype, name=name) File "C:\Anaconda3\lib\site-packages\tensorflow\python\framework\constant_op.py", line 102, in constant tensor_util.make_tensor_proto(value, dtype=dtype, shape=shape, verify_shape=verify_shape)) File "C:\Anaconda3\lib\site-packages\tensorflow\python\framework\tensor_util.py", line 360, in make_tensor_proto raise ValueError("None values not supported.") ValueError: None values not supported. ```

利用conda install TensorFlow-gpu在win7上conda3.7版本上安装tensorflow后,测试时出现下面的问题

在测试import TensorFlow as tf print('hello'),出现下列问题,请问这是什么原因造成的,如何改? ``` Traceback (most recent call last): File "D:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module> from tensorflow.python.pywrap_tensorflow_internal import * File "D:\Program Files\JetBrains\PyCharm 2019.1.3\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import module = self._system_import(name, *args, **kwargs) File "D:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module> _pywrap_tensorflow_internal = swig_import_helper() File "D:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description) File "D:\ProgramData\Anaconda3\lib\imp.py", line 242, in load_module return load_dynamic(name, filename, file) File "D:\ProgramData\Anaconda3\lib\imp.py", line 342, in load_dynamic return _load(spec) ImportError: DLL load failed: 找不到指定的程序。 During handling of the above exception, another exception occurred: Traceback (most recent call last): File "D:\ProgramData\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 3296, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "<ipython-input-2-d1ce02c95f3b>", line 1, in <module> runfile('C:/Users/jianjiu17/Desktop/deep-learning-from-scratch-master/uittle.py', wdir='C:/Users/jianjiu17/Desktop/deep-learning-from-scratch-master') File "D:\Program Files\JetBrains\PyCharm 2019.1.3\helpers\pydev\_pydev_bundle\pydev_umd.py", line 197, in runfile pydev_imports.execfile(filename, global_vars, local_vars) # execute the script File "D:\Program Files\JetBrains\PyCharm 2019.1.3\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "C:/Users/jianjiu17/Desktop/deep-learning-from-scratch-master/uittle.py", line 1, in <module> import tensorflow as tf File "D:\Program Files\JetBrains\PyCharm 2019.1.3\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import module = self._system_import(name, *args, **kwargs) File "D:\ProgramData\Anaconda3\lib\site-packages\tensorflow\__init__.py", line 24, in <module> from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import File "D:\Program Files\JetBrains\PyCharm 2019.1.3\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import module = self._system_import(name, *args, **kwargs) File "D:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\__init__.py", line 49, in <module> from tensorflow.python import pywrap_tensorflow File "D:\Program Files\JetBrains\PyCharm 2019.1.3\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import module = self._system_import(name, *args, **kwargs) File "D:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in <module> raise ImportError(msg) ImportError: Traceback (most recent call last): File "D:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module> from tensorflow.python.pywrap_tensorflow_internal import * File "D:\Program Files\JetBrains\PyCharm 2019.1.3\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import module = self._system_import(name, *args, **kwargs) File "D:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module> _pywrap_tensorflow_internal = swig_import_helper() File "D:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description) File "D:\ProgramData\Anaconda3\lib\imp.py", line 242, in load_module return load_dynamic(name, filename, file) File "D:\ProgramData\Anaconda3\lib\imp.py", line 342, in load_dynamic return _load(spec) ImportError: DLL load failed: 找不到指定的程序。 Failed to load the native TensorFlow runtime. See https://www.tensorflow.org/install/errors for some common reasons and solutions. Include the entire stack trace above this error message when asking for help. ```

keras下self-attention和Recall, F1-socre值实现问题?

麻烦大神帮忙看一下: (1)为何返回不了Precise, Recall, F1-socre值? (2)为何在CNN前加了self-attention层,训练后的acc反而降低在0.78上下? 【研一小白求详解,万分感谢大神】 ``` import os #导入os模块,用于确认文件是否存在 import numpy as np from keras.preprocessing.text import Tokenizer from keras.preprocessing.sequence import pad_sequences from keras.callbacks import Callback from sklearn.metrics import f1_score, precision_score, recall_score maxlen = 380#句子长截断为100 training_samples = 20000#在 200 个样本上训练 validation_samples = 5000#在 10 000 个样本上验证 max_words = 10000#只考虑数据集中前 10 000 个最常见的单词 def dataProcess(): imdb_dir = 'data/aclImdb'#基本路径,经常要打开这个 #处理训练集 train_dir = os.path.join(imdb_dir, 'train')#添加子路径 train_labels = [] train_texts = [] for label_type in ['neg', 'pos']: dir_name = os.path.join(train_dir, label_type) for fname in os.listdir(dir_name):#获取目录下所有文件名字 if fname[-4:] == '.txt': f = open(os.path.join(dir_name, fname),'r',encoding='utf8') train_texts.append(f.read()) f.close() if label_type == 'neg': train_labels.append(0) else:train_labels.append(1) #处理测试集 test_dir = os.path.join(imdb_dir, 'test') test_labels = [] test_texts = [] for label_type in ['neg', 'pos']: dir_name = os.path.join(test_dir, label_type) for fname in sorted(os.listdir(dir_name)): if fname[-4:] == '.txt': f = open(os.path.join(dir_name, fname),'r',encoding='utf8') test_texts.append(f.read()) f.close() if label_type == 'neg': test_labels.append(0) else: test_labels.append(1) #对数据进行分词和划分训练集和数据集 tokenizer = Tokenizer(num_words=max_words) tokenizer.fit_on_texts(train_texts)#构建单词索引结构 sequences = tokenizer.texts_to_sequences(train_texts)#整数索引的向量化模型 word_index = tokenizer.word_index#索引字典 print('Found %s unique tokens.' % len(word_index)) data = pad_sequences(sequences, maxlen=maxlen) train_labels = np.asarray(train_labels)#把列表转化为数组 print('Shape of data tensor:', data.shape) print('Shape of label tensor:', train_labels.shape) indices = np.arange(data.shape[0])#评论顺序0,1,2,3 np.random.shuffle(indices)#把评论顺序打乱3,1,2,0 data = data[indices] train_labels = train_labels[indices] x_train = data[:training_samples] y_train = train_labels[:training_samples] x_val = data[training_samples: training_samples + validation_samples] y_val = train_labels[training_samples: training_samples + validation_samples] #同样需要将测试集向量化 test_sequences = tokenizer.texts_to_sequences(test_texts) x_test = pad_sequences(test_sequences, maxlen=maxlen) y_test = np.asarray(test_labels) return x_train,y_train,x_val,y_val,x_test,y_test,word_index embedding_dim = 100#特征数设为100 #"""将预训练的glove词嵌入文件,构建成可以加载到embedding层中的嵌入矩阵""" def load_glove(word_index):#导入glove的词向量 embedding_file='data/glove.6B' embeddings_index={}#定义字典 f = open(os.path.join(embedding_file, 'glove.6B.100d.txt'),'r',encoding='utf8') for line in f: values = line.split() word = values[0] coefs = np.asarray(values[1:], dtype='float32') embeddings_index[word] = coefs f.close() # """转化为矩阵:构建可以加载到embedding层中的嵌入矩阵,形为(max_words(单词数), embedding_dim(向量维数)) """ embedding_matrix = np.zeros((max_words, embedding_dim)) for word, i in word_index.items():#字典里面的单词和索引 if i >= max_words:continue embedding_vector = embeddings_index.get(word) if embedding_vector is not None: embedding_matrix[i] = embedding_vector return embedding_matrix if __name__ == '__main__': x_train, y_train, x_val, y_val,x_test,y_test, word_index = dataProcess() embedding_matrix=load_glove(word_index) #可以把得到的嵌入矩阵保存起来,方便后面fine-tune""" # #保存 from keras.models import Sequential from keras.layers.core import Dense,Dropout,Activation,Flatten from keras.layers.recurrent import LSTM from keras.layers import Embedding from keras.layers import Bidirectional from keras.layers import Conv1D, MaxPooling1D import keras from keras_self_attention import SeqSelfAttention model = Sequential() model.add(Embedding(max_words, embedding_dim, input_length=maxlen)) model.add(SeqSelfAttention(attention_activation='sigmod')) model.add(Conv1D(filters = 64, kernel_size = 5, padding = 'same', activation = 'relu')) model.add(MaxPooling1D(pool_size = 4)) model.add(Dropout(0.25)) model.add(Bidirectional(LSTM(64,activation='tanh',dropout=0.2,recurrent_dropout=0.2))) model.add(Dense(256, activation='relu')) model.add(Dropout(0.2)) model.add(Dense(1, activation='sigmoid')) model.summary() model.layers[0].set_weights([embedding_matrix]) model.layers[0].trainable = False model.compile(optimizer='rmsprop', loss='binary_crossentropy', metrics=['acc']) class Metrics(Callback): def on_train_begin(self, logs={}): self.val_f1s = [] self.val_recalls = [] self.val_precisions = [] def on_epoch_end(self, epoch, logs={}): val_predict = (np.asarray(self.model.predict(self.validation_data[0]))).round() val_targ = self.validation_data[1] _val_f1 = f1_score(val_targ, val_predict) _val_recall = recall_score(val_targ, val_predict) _val_precision = precision_score(val_targ, val_predict) self.val_f1s.append(_val_f1) self.val_recalls.append(_val_recall) self.val_precisions.append(_val_precision) return metrics = Metrics() history = model.fit(x_train, y_train, epochs=10, batch_size=32, validation_data=(x_val, y_val), callbacks=[metrics]) model.save_weights('pre_trained_glove_model.h5')#保存结果 ```

Keras测试错误'ProgbarLogger' no attribute 'log_values'

Keras 简单程序测试,出现如下错位,请问如何解决: Apple@Host~/test$ python3 kt.py Using Theano backend. -------------------------------------------------- Iteration 1 Train on 0 samples, validate on 0 samples Epoch 1/2 Traceback (most recent call last): File "ktest2.py", line 189, in <module> model.fit(inputs, labels, batch_size=batch_size, nb_epoch=2, validation_split = 0.1) File "/usr/local/lib/python3.5/dist-packages/keras/models.py", line 672, in fit initial_epoch=initial_epoch) File "/usr/local/lib/python3.5/dist-packages/keras/engine/training.py", line 1196, in fit initial_epoch=initial_epoch) File "/usr/local/lib/python3.5/dist-packages/keras/engine/training.py", line 911, in _fit_loop callbacks.on_epoch_end(epoch, epoch_logs) File "/usr/local/lib/python3.5/dist-packages/keras/callbacks.py", line 76, in on_epoch_end callback.on_epoch_end(epoch, logs) File "/usr/local/lib/python3.5/dist-packages/keras/callbacks.py", line 265, in on_epoch_end self.progbar.update(self.seen, self.log_values, force=True) AttributeError: 'ProgbarLogger' object has no attribute 'log_values' Apple@Host:~/test$

Mac上用pip装了tensorflow,但是在sublimetext中没办法import。

Mac上用pip装了tensorflow,但是在sublimetext中没办法import。显示 “ImportError: No module named tensorflow” [图片说明](https://img-ask.csdn.net/upload/201908/04/1564921422_85083.png) [图片说明](https://img-ask.csdn.net/upload/201908/04/1564921475_668000.png) 求助!谢谢了。

C++调用python 控制台可以成功,mfc失败,python脚本里依赖tensorflow

x64控制台与MFC控制台同样的配置; 关键C++代码如下: ``` #define PY_modePath L"E:\\Anaconda\\envs\\asr\\" ``` Py_SetPythonHome(PY_modePath); pModule = PyImport_ImportModule(aasr.c_str());//mfc是null 控制台是OK的 python代码如下: ``` #!/usr/bin/env python3 # -*- coding: utf-8 -*- ``` """ @author: sly """ import platform as plat import os import time from general_function.file_wav import * from general_function.file_dict import * from general_function.gen_func import * import numpy as np import random from keras.models import Sequential, Model from keras.layers import Dense, Dropout, Input, Reshape, BatchNormalization # , Flatten from keras.layers import Lambda, TimeDistributed, Activation,Conv2D, MaxPooling2D #, Merge from keras import backend as K from keras.optimizers import SGD, Adadelta, Adam ``` ``` 路径检查多边没有问题. 对边了加载脚本时C++输出:

装TensorFlow出现了这些问题是什么情况呀

(TF2.1) C:\Users\lenovo>pip install tensorflow==2.1 Requirement already satisfied: tensorflow==2.1 in f:\anaconda3\envs\tf2.1\lib\site-packages (2.1.0) Requirement already satisfied: termcolor>=1.1.0 in f:\anaconda3\envs\tf2.1\lib\site-packages (from tensorflow==2.1) (1.1.0) Requirement already satisfied: protobuf>=3.8.0 in f:\anaconda3\envs\tf2.1\lib\site-packages (from tensorflow==2.1) (3.11.3) Requirement already satisfied: absl-py>=0.7.0 in f:\anaconda3\envs\tf2.1\lib\site-packages (from tensorflow==2.1) (0.9.0) Requirement already satisfied: opt-einsum>=2.3.2 in f:\anaconda3\envs\tf2.1\lib\site-packages (from tensorflow==2.1) (3.2.1) Requirement already satisfied: google-pasta>=0.1.6 in f:\anaconda3\envs\tf2.1\lib\site-packages (from tensorflow==2.1) (0.2.0) Requirement already satisfied: wheel>=0.26; python_version >= "3" in f:\anaconda3\envs\tf2.1\lib\site-packages (from tensorflow==2.1) (0.34.2) Requirement already satisfied: wrapt>=1.11.1 in f:\anaconda3\envs\tf2.1\lib\site-packages (from tensorflow==2.1) (1.12.1) Requirement already satisfied: gast==0.2.2 in f:\anaconda3\envs\tf2.1\lib\site-packages (from tensorflow==2.1) (0.2.2) Requirement already satisfied: six>=1.12.0 in f:\anaconda3\envs\tf2.1\lib\site-packages (from tensorflow==2.1) (1.14.0) Requirement already satisfied: numpy<2.0,>=1.16.0 in f:\anaconda3\envs\tf2.1\lib\site-packages (from tensorflow==2.1) (1.18.4) Requirement already satisfied: tensorboard<2.2.0,>=2.1.0 in f:\anaconda3\envs\tf2.1\lib\site-packages (from tensorflow==2.1) (2.1.1) Requirement already satisfied: tensorflow-estimator<2.2.0,>=2.1.0rc0 in f:\anaconda3\envs\tf2.1\lib\site-packages (from tensorflow==2.1) (2.1.0) Requirement already satisfied: grpcio>=1.8.6 in f:\anaconda3\envs\tf2.1\lib\site-packages (from tensorflow==2.1) (1.28.1) Requirement already satisfied: astor>=0.6.0 in f:\anaconda3\envs\tf2.1\lib\site-packages (from tensorflow==2.1) (0.8.1) Requirement already satisfied: scipy==1.4.1; python_version >= "3" in f:\anaconda3\envs\tf2.1\lib\site-packages (from tensorflow==2.1) (1.4.1) Requirement already satisfied: keras-applications>=1.0.8 in f:\anaconda3\envs\tf2.1\lib\site-packages (from tensorflow==2.1) (1.0.8) Requirement already satisfied: keras-preprocessing>=1.1.0 in f:\anaconda3\envs\tf2.1\lib\site-packages (from tensorflow==2.1) (1.1.0) Requirement already satisfied: setuptools in f:\anaconda3\envs\tf2.1\lib\site-packages (from protobuf>=3.8.0->tensorflow==2.1) (46.1.3.post20200330) Requirement already satisfied: markdown>=2.6.8 in f:\anaconda3\envs\tf2.1\lib\site-packages (from tensorboard<2.2.0,>=2.1.0->tensorflow==2.1) (3.2.1) Requirement already satisfied: google-auth<2,>=1.6.3 in f:\anaconda3\envs\tf2.1\lib\site-packages (from tensorboard<2.2.0,>=2.1.0->tensorflow==2.1) (1.14.1) Requirement already satisfied: google-auth-oauthlib<0.5,>=0.4.1 in f:\anaconda3\envs\tf2.1\lib\site-packages (from tensorboard<2.2.0,>=2.1.0->tensorflow==2.1) (0.4.1) Requirement already satisfied: werkzeug>=0.11.15 in f:\anaconda3\envs\tf2.1\lib\site-packages (from tensorboard<2.2.0,>=2.1.0->tensorflow==2.1) (1.0.1) Requirement already satisfied: requests<3,>=2.21.0 in f:\anaconda3\envs\tf2.1\lib\site-packages (from tensorboard<2.2.0,>=2.1.0->tensorflow==2.1) (2.23.0) Requirement already satisfied: h5py in f:\anaconda3\envs\tf2.1\lib\site-packages (from keras-applications>=1.0.8->tensorflow==2.1) (2.10.0) Requirement already satisfied: pyasn1-modules>=0.2.1 in f:\anaconda3\envs\tf2.1\lib\site-packages (from google-auth<2,>=1.6.3->tensorboard<2.2.0,>=2.1.0->tensorflow==2.1) (0.2.8) Requirement already satisfied: rsa<4.1,>=3.1.4 in f:\anaconda3\envs\tf2.1\lib\site-packages (from google-auth<2,>=1.6.3->tensorboard<2.2.0,>=2.1.0->tensorflow==2.1) (4.0) Requirement already satisfied: cachetools<5.0,>=2.0.0 in f:\anaconda3\envs\tf2.1\lib\site-packages (from google-auth<2,>=1.6.3->tensorboard<2.2.0,>=2.1.0->tensorflow==2.1) (4.1.0) Requirement already satisfied: requests-oauthlib>=0.7.0 in f:\anaconda3\envs\tf2.1\lib\site-packages (from google-auth-oauthlib<0.5,>=0.4.1->tensorboard<2.2.0,>=2.1.0->tensorflow==2.1) (1.3.0) Requirement already satisfied: chardet<4,>=3.0.2 in f:\anaconda3\envs\tf2.1\lib\site-packages (from requests<3,>=2.21.0->tensorboard<2.2.0,>=2.1.0->tensorflow==2.1) (3.0.4) Requirement already satisfied: idna<3,>=2.5 in f:\anaconda3\envs\tf2.1\lib\site-packages (from requests<3,>=2.21.0->tensorboard<2.2.0,>=2.1.0->tensorflow==2.1) (2.9) Requirement already satisfied: certifi>=2017.4.17 in f:\anaconda3\envs\tf2.1\lib\site-packages (from requests<3,>=2.21.0->tensorboard<2.2.0,>=2.1.0->tensorflow==2.1) (2020.4.5.1) Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in f:\anaconda3\envs\tf2.1\lib\site-packages (from requests<3,>=2.21.0->tensorboard<2.2.0,>=2.1.0->tensorflow==2.1) (1.25.9) Requirement already satisfied: pyasn1<0.5.0,>=0.4.6 in f:\anaconda3\envs\tf2.1\lib\site-packages (from pyasn1-modules>=0.2.1->google-auth<2,>=1.6.3->tensorboard<2.2.0,>=2.1.0->tensorflow==2.1) (0.4.8) Requirement already satisfied: oauthlib>=3.0.0 in f:\anaconda3\envs\tf2.1\lib\site-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<0.5,>=0.4.1->tensorboard<2.2.0,>=2.1.0->tensorflow==2.1) (3.1.0) (TF2.1) C:\Users\lenovo>python Python 3.7.7 (default, Apr 15 2020, 05:09:04) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import tensorflow as tf Traceback (most recent call last): File "F:\anaconda3\envs\TF2.1\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in <module> from tensorflow.python.pywrap_tensorflow_internal import * File "F:\anaconda3\envs\TF2.1\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in <module> _pywrap_tensorflow_internal = swig_import_helper() File "F:\anaconda3\envs\TF2.1\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description) File "F:\anaconda3\envs\TF2.1\lib\imp.py", line 242, in load_module return load_dynamic(name, filename, file) File "F:\anaconda3\envs\TF2.1\lib\imp.py", line 342, in load_dynamic return _load(spec) ImportError: DLL load failed: 找不到指定的模块。 During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "F:\anaconda3\envs\TF2.1\lib\site-packages\tensorflow\__init__.py", line 101, in <module> from tensorflow_core import * File "F:\anaconda3\envs\TF2.1\lib\site-packages\tensorflow_core\__init__.py", line 40, in <module> from tensorflow.python.tools import module_util as _module_util File "F:\anaconda3\envs\TF2.1\lib\site-packages\tensorflow\__init__.py", line 50, in __getattr__ module = self._load() File "F:\anaconda3\envs\TF2.1\lib\site-packages\tensorflow\__init__.py", line 44, in _load module = _importlib.import_module(self.__name__) File "F:\anaconda3\envs\TF2.1\lib\importlib\__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "F:\anaconda3\envs\TF2.1\lib\site-packages\tensorflow_core\python\__init__.py", line 49, in <module> from tensorflow.python import pywrap_tensorflow File "F:\anaconda3\envs\TF2.1\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 74, in <module> raise ImportError(msg) ImportError: Traceback (most recent call last): File "F:\anaconda3\envs\TF2.1\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in <module> from tensorflow.python.pywrap_tensorflow_internal import * File "F:\anaconda3\envs\TF2.1\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in <module> _pywrap_tensorflow_internal = swig_import_helper() File "F:\anaconda3\envs\TF2.1\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description) File "F:\anaconda3\envs\TF2.1\lib\imp.py", line 242, in load_module return load_dynamic(name, filename, file) File "F:\anaconda3\envs\TF2.1\lib\imp.py", line 342, in load_dynamic return _load(spec) ImportError: DLL load failed: 找不到指定的模块。 Failed to load the native TensorFlow runtime. See https://www.tensorflow.org/install/errors for some common reasons and solutions. Include the entire stack trace above this error message when asking for help.

初级玩转Linux+Ubuntu(嵌入式开发基础课程)

课程主要面向嵌入式Linux初学者、工程师、学生 主要从一下几方面进行讲解: 1.linux学习路线、基本命令、高级命令 2.shell、vi及vim入门讲解 3.软件安装下载、NFS、Samba、FTP等服务器配置及使用

我以为我对Mysql事务很熟,直到我遇到了阿里面试官

太惨了,面试又被吊打

Python代码实现飞机大战

文章目录经典飞机大战一.游戏设定二.我方飞机三.敌方飞机四.发射子弹五.发放补给包六.主模块 经典飞机大战 源代码以及素材资料(图片,音频)可从下面的github中下载: 飞机大战源代码以及素材资料github项目地址链接 ————————————————————————————————————————————————————————— 不知道大家有没有打过飞机,喜不喜欢打飞机。当我第一次接触这个东西的时候,我的内心是被震撼到的。第一次接触打飞机的时候作者本人是身心愉悦的,因为周边的朋友都在打飞机, 每

Python数据分析与挖掘

92讲视频课+16大项目实战+源码+¥800元课程礼包+讲师社群1V1答疑+社群闭门分享会=99元 &nbsp; 为什么学习数据分析? &nbsp; &nbsp; &nbsp; 人工智能、大数据时代有什么技能是可以运用在各种行业的?数据分析就是。 &nbsp; &nbsp; &nbsp; 从海量数据中获得别人看不见的信息,创业者可以通过数据分析来优化产品,营销人员可以通过数据分析改进营销策略,产品经理可以通过数据分析洞察用户习惯,金融从业者可以通过数据分析规避投资风险,程序员可以通过数据分析进一步挖掘出数据价值,它和编程一样,本质上也是一个工具,通过数据来对现实事物进行分析和识别的能力。不管你从事什么行业,掌握了数据分析能力,往往在其岗位上更有竞争力。 &nbsp;&nbsp; 本课程共包含五大模块: 一、先导篇: 通过分析数据分析师的一天,让学员了解全面了解成为一个数据分析师的所有必修功法,对数据分析师不在迷惑。 &nbsp; 二、基础篇: 围绕Python基础语法介绍、数据预处理、数据可视化以及数据分析与挖掘......这些核心技能模块展开,帮助你快速而全面的掌握和了解成为一个数据分析师的所有必修功法。 &nbsp; 三、数据采集篇: 通过网络爬虫实战解决数据分析的必经之路:数据从何来的问题,讲解常见的爬虫套路并利用三大实战帮助学员扎实数据采集能力,避免没有数据可分析的尴尬。 &nbsp; 四、分析工具篇: 讲解数据分析避不开的科学计算库Numpy、数据分析工具Pandas及常见可视化工具Matplotlib。 &nbsp; 五、算法篇: 算法是数据分析的精华,课程精选10大算法,包括分类、聚类、预测3大类型,每个算法都从原理和案例两个角度学习,让你不仅能用起来,了解原理,还能知道为什么这么做。

如何在虚拟机VM上使用串口

在系统内核开发中,经常会用到串口调试,利用VMware的Virtual Machine更是为调试系统内核如虎添翼。那么怎么搭建串口调试环境呢?因为最近工作涉及到这方面,利用强大的google搜索和自己

程序员的兼职技能课

获取讲师答疑方式: 在付费视频第一节(触摸命令_ALL)片头有二维码及加群流程介绍 限时福利 原价99元,今日仅需39元!购课添加小助手(微信号:csdn590)按提示还可领取价值800元的编程大礼包! 讲师介绍: 苏奕嘉&nbsp;前阿里UC项目工程师 脚本开发平台官方认证满级(六级)开发者。 我将如何教会你通过【定制脚本】赚到你人生的第一桶金? 零基础程序定制脚本开发课程,是完全针对零脚本开发经验的小白而设计,课程内容共分为3大阶段: ①前期将带你掌握Q开发语言和界面交互开发能力; ②中期通过实战来制作有具体需求的定制脚本; ③后期将解锁脚本的更高阶玩法,打通任督二脉; ④应用定制脚本合法赚取额外收入的完整经验分享,带你通过程序定制脚本开发这项副业,赚取到你的第一桶金!

MFC一站式终极全套课程包

该套餐共包含从C小白到C++到MFC的全部课程,整套学下来绝对成为一名C++大牛!!!

C++语言基础视频教程

C++语言基础视频培训课程:本课与主讲者在大学开出的程序设计课程直接对接,准确把握知识点,注重教学视频与实践体系的结合,帮助初学者有效学习。本教程详细介绍C++语言中的封装、数据隐藏、继承、多态的实现等入门知识;主要包括类的声明、对象定义、构造函数和析构函数、运算符重载、继承和派生、多态性实现等。 课程需要有C语言程序设计的基础(可以利用本人开出的《C语言与程序设计》系列课学习)。学习者能够通过实践的方式,学会利用C++语言解决问题,具备进一步学习利用C++开发应用程序的基础。

北京师范大学信息科学与技术学院笔试10复试真题

北京师范大学信息科学与技术学院笔试,可以更好的让你了解北师大该学院的复试内容,获得更好的成绩。

深度学习原理+项目实战+算法详解+主流框架(套餐)

深度学习系列课程从深度学习基础知识点开始讲解一步步进入神经网络的世界再到卷积和递归神经网络,详解各大经典网络架构。实战部分选择当下最火爆深度学习框架PyTorch与Tensorflow/Keras,全程实战演示框架核心使用与建模方法。项目实战部分选择计算机视觉与自然语言处理领域经典项目,从零开始详解算法原理,debug模式逐行代码解读。适合准备就业和转行的同学们加入学习! 建议按照下列课程顺序来进行学习 (1)掌握深度学习必备经典网络架构 (2)深度框架实战方法 (3)计算机视觉与自然语言处理项目实战。(按照课程排列顺序即可)

网络工程师小白入门--【思科CCNA、华为HCNA等网络工程师认证】

本课程适合CCNA或HCNA网络小白同志,高手请绕道,可以直接学习进价课程。通过本预科课程的学习,为学习网络工程师、思科CCNA、华为HCNA这些认证打下坚实的基础! 重要!思科认证2020年2月24日起,已启用新版认证和考试,包括题库都会更新,由于疫情原因,请关注官网和本地考点信息。题库网络上很容易下载到。

Python界面版学生管理系统

前不久上传了一个控制台版本的学生管理系统,这个是Python界面版学生管理系统,这个是使用pycharm开发的一个有界面的学生管理系统,基本的增删改查,里面又演示视频和完整代码,有需要的伙伴可以自行下

软件测试2小时入门

本课程内容系统、全面、简洁、通俗易懂,通过2个多小时的介绍,让大家对软件测试有个系统的理解和认识,具备基本的软件测试理论基础。 主要内容分为5个部分: 1 软件测试概述,了解测试是什么、测试的对象、原则、流程、方法、模型;&nbsp; 2.常用的黑盒测试用例设计方法及示例演示;&nbsp; 3 常用白盒测试用例设计方法及示例演示;&nbsp; 4.自动化测试优缺点、使用范围及示例‘;&nbsp; 5.测试经验谈。

Tomcat服务器下载、安装、配置环境变量教程(超详细)

未经我的允许,请不要转载我的文章,在此郑重声明!!! 请先配置安装好Java的环境,若没有安装,请参照我博客上的步骤进行安装! 安装Java环境教程https://blog.csdn.net/qq_40881680/article/details/83585542 Tomcat部署Web项目(一)·内嵌https://blog.csdn.net/qq_40881680/article/d...

2019数学建模A题高压油管的压力控制 省一论文即代码

2019数学建模A题高压油管的压力控制省一完整论文即详细C++和Matlab代码,希望对同学们有所帮助

图书管理系统(Java + Mysql)我的第一个完全自己做的实训项目

图书管理系统 Java + MySQL 完整实训代码,MVC三层架构组织,包含所有用到的图片资源以及数据库文件,大三上学期实训,注释很详细,按照阿里巴巴Java编程规范编写

linux下利用/proc进行进程树的打印

在linux下利用c语言实现的进程树的打印,主要通过/proc下的目录中的进程文件,获取status中的进程信息内容,然后利用递归实现进程树的打印

微信小程序开发实战之番茄时钟开发

微信小程序番茄时钟视频教程,本课程将带着各位学员开发一个小程序初级实战类项目,针对只看过官方文档而又无从下手的开发者来说,可以作为一个较好的练手项目,对于有小程序开发经验的开发者而言,可以更好加深对小程序各类组件和API 的理解,为更深层次高难度的项目做铺垫。

[已解决]踩过的坑之mysql连接报“Communications link failure”错误

目录 前言 第一种方法: 第二种方法 第三种方法(适用于项目和数据库在同一台服务器) 第四种方法 第五种方法(项目和数据库不在同一台服务器) 总结 前言 先给大家简述一下我的坑吧,(我用的是mysql,至于oracle有没有这样的问题,有心的小伙伴们可以测试一下哈), 在自己做个javaweb测试项目的时候,因为买的是云服务器,所以数据库连接的是用ip地址,用IDE开发好...

人工智能-计算机视觉实战之路(必备算法+深度学习+项目实战)

系列课程主要分为3大阶段:(1)首先掌握计算机视觉必备算法原理,结合Opencv进行学习与练手,通过实际视项目进行案例应用展示。(2)进军当下最火的深度学习进行视觉任务实战,掌握深度学习中必备算法原理与网络模型架构。(3)结合经典深度学习框架与实战项目进行实战,基于真实数据集展开业务分析与建模实战。整体风格通俗易懂,项目驱动学习与就业面试。 建议同学们按照下列顺序来进行学习:1.Python入门视频课程 2.Opencv计算机视觉实战(Python版) 3.深度学习框架-PyTorch实战/人工智能框架实战精讲:Keras项目 4.Python-深度学习-物体检测实战 5.后续实战课程按照自己喜好选择就可以

2019 AI开发者大会

2019 AI开发者大会(AI ProCon 2019)是由中国IT社区CSDN主办的AI技术与产业年度盛会。多年经验淬炼,如今蓄势待发:2019年9月6-7日,大会将有近百位中美顶尖AI专家、知名企业代表以及千余名AI开发者齐聚北京,进行技术解读和产业论证。我们不空谈口号,只谈技术,诚挚邀请AI业内人士一起共铸人工智能新篇章!

机器学习初学者必会的案例精讲

通过六个实际的编码项目,带领同学入门人工智能。这些项目涉及机器学习(回归,分类,聚类),深度学习(神经网络),底层数学算法,Weka数据挖掘,利用Git开源项目实战等。

Python数据分析师-实战系列

系列课程主要包括Python数据分析必备工具包,数据分析案例实战,核心算法实战与企业级数据分析与建模解决方案实战,建议大家按照系列课程阶段顺序进行学习。所有数据集均为企业收集的真实数据集,整体风格以实战为导向,通俗讲解Python数据分析核心技巧与实战解决方案。

YOLOv3目标检测实战系列课程

《YOLOv3目标检测实战系列课程》旨在帮助大家掌握YOLOv3目标检测的训练、原理、源码与网络模型改进方法。 本课程的YOLOv3使用原作darknet(c语言编写),在Ubuntu系统上做项目演示。 本系列课程包括三门课: (1)《YOLOv3目标检测实战:训练自己的数据集》 包括:安装darknet、给自己的数据集打标签、整理自己的数据集、修改配置文件、训练自己的数据集、测试训练出的网络模型、性能统计(mAP计算和画出PR曲线)和先验框聚类。 (2)《YOLOv3目标检测:原理与源码解析》讲解YOLOv1、YOLOv2、YOLOv3的原理、程序流程并解析各层的源码。 (3)《YOLOv3目标检测:网络模型改进方法》讲解YOLOv3的改进方法,包括改进1:不显示指定类别目标的方法 (增加功能) ;改进2:合并BN层到卷积层 (加快推理速度) ; 改进3:使用GIoU指标和损失函数 (提高检测精度) ;改进4:tiny YOLOv3 (简化网络模型)并介绍 AlexeyAB/darknet项目。

2021考研数学张宇基础30讲.pdf

张宇:博士,全国著名考研数学辅导专家,教育部“国家精品课程建设骨干教师”,全国畅销书《张宇高等数学18讲》《张宇线性代数9讲》《张宇概率论与数理统计9讲》《张宇考研数学题源探析经典1000题》《张宇考

三个项目玩转深度学习(附1G源码)

从事大数据与人工智能开发与实践约十年,钱老师亲自见证了大数据行业的发展与人工智能的从冷到热。事实证明,计算机技术的发展,算力突破,海量数据,机器人技术等,开启了第四次工业革命的序章。深度学习图像分类一直是人工智能的经典任务,是智慧零售、安防、无人驾驶等机器视觉应用领域的核心技术之一,掌握图像分类技术是机器视觉学习的重中之重。针对现有线上学习的特点与实际需求,我们开发了人工智能案例实战系列课程。打造:以项目案例实践为驱动的课程学习方式,覆盖了智能零售,智慧交通等常见领域,通过基础学习、项目案例实践、社群答疑,三维立体的方式,打造最好的学习效果。

DirectX修复工具V4.0增强版

DirectX修复工具(DirectX Repair)是一款系统级工具软件,简便易用。本程序为绿色版,无需安装,可直接运行。 本程序的主要功能是检测当前系统的DirectX状态,如果发现异常则进行修复

期末考试评分标准的数学模型

大学期末考试与高中的考试存在很大的不同之处,大学的期末考试成绩是主要分为两个部分:平时成绩和期末考试成绩。平时成绩和期末考试成绩总分一般为一百分,然而平时成绩与期末考试成绩所占的比例不同会导致出现不同

Vue.js 2.0之全家桶系列视频课程

基于新的Vue.js 2.3版本, 目前新全的Vue.js教学视频,让你少走弯路,直达技术前沿! 1. 包含Vue.js全家桶(vue.js、vue-router、axios、vuex、vue-cli、webpack、ElementUI等) 2. 采用笔记+代码案例的形式讲解,通俗易懂

c语言项目开发实例

十个c语言案例 (1)贪吃蛇 (2)五子棋游戏 (3)电话薄管理系统 (4)计算器 (5)万年历 (6)电子表 (7)客户端和服务器通信 (8)潜艇大战游戏 (9)鼠标器程序 (10)手机通讯录系统

相关热词 c#中如何设置提交按钮 c#帮助怎么用 c# 读取合并单元格的值 c#带阻程序 c# 替换span内容 c# rpc c#控制台点阵字输出 c#do while循环 c#调用dll多线程 c#找出两个集合不同的
立即提问