DENSE

DENSE:
https://blog.csdn.net/u012969412/article/details/70882296

E tensorflow/stream_executor/cuda/cuda_blas.cc:372] failed to create cublas handle: CUBLAS_STATUS_NOT_INITIALIZED
W tensorflow/stream_executor/stream.cc:1390] attempting to perform BLAS operation using StreamExecutor without BLAS support
Traceback (most recent call last):
File “/home/zhangdawei/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py”, line 1022, in _do_call
return fn(*args)
File “/home/zhangdawei/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py”, line 1004, in _run_fn
status, run_metadata)
File “/home/zhangdawei/anaconda3/lib/python3.6/contextlib.py”, line 88, in exit
next(self.gen)
File “/home/zhangdawei/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/errors_impl.py”, line 466, in raise_exception_on_not_ok_status
pywrap_tensorflow.TF_GetCode(status))
tensorflow.python.framework.errors_impl.InternalError: Blas SGEMM launch failed : a.shape=(2, 18), b.shape=(18, 24), m=2, n=24, k=18
[[Node: lstm_1/MatMul = MatMul[T=DT_FLOAT, transpose_a=false, transpose_b=false, _device="/job:localhost/replica:0/task:0/gpu:0"](lstm_1/Reshape, lstm_1/strided_slice)]]
[[Node: mul_1/_51 = _Recvclient_terminated=false, recv_device="/job:localhost/replica:0/task:0/cpu:0", send_device="/job:localhost/replica:0/task:0/gpu:0", send_device_incarnation=1, tensor_name=“edge_2806_mul_1”, tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/cpu:0"]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/home/zhangdawei/Desktop/Human-Activity-Recognition-master1/main.py”, line 122, in
model.fit(X_train, y_train, epochs=3, batch_size=pow(2,i))
File “/home/zhangdawei/anaconda3/lib/python3.6/site-packages/keras/models.py”, line 870, in fit
initial_epoch=initial_epoch)
File “/home/zhangdawei/anaconda3/lib/python3.6/site-packages/keras/engine/training.py”, line 1507, in fit
initial_epoch=initial_epoch)
File “/home/zhangdawei/anaconda3/lib/python3.6/site-packages/keras/engine/training.py”, line 1156, in _fit_loop
outs = f(ins_batch)
File “/home/zhangdawei/anaconda3/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py”, line 2269, in call
**self.session_kwargs)
File “/home/zhangdawei/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py”, line 767, in run
run_metadata_ptr)
File “/home/zhangdawei/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py”, line 965, in _run
feed_dict_string, options, run_metadata)
File “/home/zhangdawei/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py”, line 1015, in _do_run
target_list, options, run_metadata)
File “/home/zhangdawei/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py”, line 1035, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InternalError: Blas SGEMM launch failed : a.shape=(2, 18), b.shape=(18, 24), m=2, n=24, k=18
[[Node: lstm_1/MatMul = MatMul[T=DT_FLOAT, transpose_a=false, transpose_b=false, _device="/job:localhost/replica:0/task:0/gpu:0"](lstm_1/Reshape, lstm_1/strided_slice)]]
[[Node: mul_1/_51 = _Recvclient_terminated=false, recv_device="/job:localhost/replica:0/task:0/cpu:0", send_device="/job:localhost/replica:0/task:0/gpu:0", send_device_incarnation=1, tensor_name=“edge_2806_mul_1”, tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/cpu:0"]]

Caused by op ‘lstm_1/MatMul’, defined at:
File “/home/zhangdawei/Desktop/Human-Activity-Recognition-master1/main.py”, line 101, in
model.add(LSTM(24, input_dim = parameters1,return_sequences=True))
File “/home/zhangdawei/anaconda3/lib/python3.6/site-packages/keras/models.py”, line 443, in add
layer(x)
File “/home/zhangdawei/anaconda3/lib/python3.6/site-packages/keras/layers/recurrent.py”, line 262, in call
return super(Recurrent, self).call(inputs, **kwargs)
File “/home/zhangdawei/anaconda3/lib/python3.6/site-packages/keras/engine/topology.py”, line 596, in call
output = self.call(inputs, **kwargs)
File “/home/zhangdawei/anaconda3/lib/python3.6/site-packages/keras/layers/recurrent.py”, line 333, in call
preprocessed_input = self.preprocess_input(inputs, training=None)
File “/home/zhangdawei/anaconda3/lib/python3.6/site-packages/keras/layers/recurrent.py”, line 1077, in preprocess_input
timesteps, training=training)
File “/home/zhangdawei/anaconda3/lib/python3.6/site-packages/keras/layers/recurrent.py”, line 50, in _time_distributed_dense
x = K.dot(x, w)
File “/home/zhangdawei/anaconda3/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py”, line 976, in dot
out = tf.matmul(x, y)
File “/home/zhangdawei/anaconda3/lib/python3.6/site-packages/tensorflow/python/ops/math_ops.py”, line 1765, in matmul
a, b, transpose_a=transpose_a, transpose_b=transpose_b, name=name)
File “/home/zhangdawei/anaconda3/lib/python3.6/site-packages/tensorflow/python/ops/gen_math_ops.py”, line 1454, in _mat_mul
transpose_b=transpose_b, name=name)
File “/home/zhangdawei/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py”, line 763, in apply_op
op_def=op_def)
File “/home/zhangdawei/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/ops.py”, line 2327, in create_op
original_op=self._default_original_op, op_def=op_def)
File “/home/zhangdawei/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/ops.py”, line 1226, in init
self._traceback = _extract_stack()

InternalError (see above for traceback): Blas SGEMM launch failed : a.shape=(2, 18), b.shape=(18, 24), m=2, n=24, k=18
[[Node: lstm_1/MatMul = MatMul[T=DT_FLOAT, transpose_a=false, transpose_b=false, _device="/job:localhost/replica:0/task:0/gpu:0"](lstm_1/Reshape, lstm_1/strided_slice)]]
[[Node: mul_1/_51 = _Recvclient_terminated=false, recv_device="/job:localhost/replica:0/task:0/cpu:0", send_device="/job:localhost/replica:0/task:0/gpu:0", send_device_incarnation=1, tensor_name=“edge_2806_mul_1”, tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/cpu:0"]]

4.11
Traceback (most recent call last):
File “/usr/lib/python3.5/tkinter/init.py”, line 36, in
import _tkinter
ImportError: No module named ‘_tkinter’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/home/zhangdawei/my/Human-Activity-Recognition-master1/main.py”, line 5, in
import matplotlib.pyplot as plt
File “/home/zhangdawei/my/Human-Activity-Recognition-master1/venv/lib/python3.5/site-packages/matplotlib/pyplot.py”, line 2372, in
switch_backend(rcParams[“backend”])
File “/home/zhangdawei/my/Human-Activity-Recognition-master1/venv/lib/python3.5/site-packages/matplotlib/pyplot.py”, line 207, in switch_backend
backend_mod = importlib.import_module(backend_name)
File “/usr/lib/python3.5/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “/home/zhangdawei/my/Human-Activity-Recognition-master1/venv/lib/python3.5/site-packages/matplotlib/backends/backend_tkagg.py”, line 1, in
from . import _backend_tk
File “/home/zhangdawei/my/Human-Activity-Recognition-master1/venv/lib/python3.5/site-packages/matplotlib/backends/_backend_tk.py”, line 5, in
import tkinter as Tk
File “/usr/lib/python3.5/tkinter/init.py”, line 38, in
raise ImportError(str(msg) + ‘, please install the python3-tk package’)
ImportError: No module named ‘_tkinter’, please install the python3-tk package

4 12
https://blog.csdn.net/weixin_39147616/article/details/89141709
Get:1 file:/var/cuda-repo-8-0-local-ga2 InRelease
Ign:1 file:/var/cuda-repo-8-0-local-ga2 InRelease
Err:2 https://packages.microsoft.com/repos/vscode stable InRelease
Failed to connect to 127.0.0.1 port 37337: Connection refused
Get:3 file:/var/cuda-repo-8-0-local-ga2 Release [574 B]
Get:3 file:/var/cuda-repo-8-0-local-ga2 Release [574 B]
Err:5 http://archive.canonical.com lucid InRelease
Could not connect to 127.0.0.1:37337 (127.0.0.1). - connect (111: Connection refused)
Err:6 http://dl.google.com/linux/chrome/deb stable InRelease
Could not connect to 127.0.0.1:37337 (127.0.0.1). - connect (111: Connection refused)
Err:7 http://extras.ubuntu.com/ubuntu precise InRelease
Could not connect to 127.0.0.1:37337 (127.0.0.1). - connect (111: Connection refused)
Err:8 http://mirrors.163.com/ubuntu precise InRelease
Could not connect to 127.0.0.1:37337 (127.0.0.1). - connect (111: Connection refused)
Err:9 http://mirrors.163.com/ubuntu precise-updates InRelease
Unable to connect to 127.0.0.1:37337:
Err:10 http://archive.ubuntukylin.com:10006/ubuntukylin xenial InRelease
Could not connect to 127.0.0.1:37337 (127.0.0.1). - connect (111: Connection refused)
Err:11 http://mirrors.163.com/ubuntu precise-backports InRelease
Unable to connect to 127.0.0.1:37337:
Err:12 http://mirrors.163.com/ubuntu precise-security InRelease
Unable to connect to 127.0.0.1:37337:
Err:13 http://mirrors.yun-idc.com/ubuntu xenial InRelease
Could not connect to 127.0.0.1:37337 (127.0.0.1). - connect (111: Connection refused)
Err:14 http://ppa.launchpad.net/chris-lea/libsodium/ubuntu xenial InRelease
Could not connect to 127.0.0.1:37337 (127.0.0.1). - connect (111: Connection refused)
Err:15 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu xenial InRelease
Unable to connect to 127.0.0.1:37337:
Err:16 http://mirrors.yun-idc.com/ubuntu xenial-updates InRelease
Unable to connect to 127.0.0.1:37337:
Err:17 http://mirrors.yun-idc.com/ubuntu xenial-backports InRelease
Unable to connect to 127.0.0.1:37337:
Err:18 http://mirrors.yun-idc.com/ubuntu xenial-security InRelease
Unable to connect to 127.0.0.1:37337:
Reading package lists… Done
W: Failed to fetch http://mirrors.yun-idc.com/ubuntu/dists/xenial/InRelease Could not connect to 127.0.0.1:37337 (127.0.0.1). - connect (111: Connection refused)
W: Failed to fetch http://mirrors.yun-idc.com/ubuntu/dists/xenial-updates/InRelease Unable to connect to 127.0.0.1:37337:
W: Failed to fetch http://mirrors.yun-idc.com/ubuntu/dists/xenial-backports/InRelease Unable to connect to 127.0.0.1:37337:
W: Failed to fetch http://mirrors.yun-idc.com/ubuntu/dists/xenial-security/InRelease Unable to connect to 127.0.0.1:37337:
W: Failed to fetch http://mirrors.163.com/ubuntu/dists/precise/InRelease Could not connect to 127.0.0.1:37337 (127.0.0.1). - connect (111: Connection refused)
W: Failed to fetch http://mirrors.163.com/ubuntu/dists/precise-updates/InRelease Unable to connect to 127.0.0.1:37337:
W: Failed to fetch http://mirrors.163.com/ubuntu/dists/precise-backports/InRelease Unable to connect to 127.0.0.1:37337:
W: Failed to fetch http://mirrors.163.com/ubuntu/dists/precise-security/InRelease Unable to connect to 127.0.0.1:37337:
W: Failed to fetch http://extras.ubuntu.com/ubuntu/dists/precise/InRelease Could not connect to 127.0.0.1:37337 (127.0.0.1). - connect (111: Connection refused)
W: Failed to fetch http://archive.canonical.com/dists/lucid/InRelease Could not connect to 127.0.0.1:37337 (127.0.0.1). - connect (111: Connection refused)
W: Failed to fetch http://ppa.launchpad.net/chris-lea/libsodium/ubuntu/dists/xenial/InRelease Could not connect to 127.0.0.1:37337 (127.0.0.1). - connect (111: Connection refused)
W: Failed to fetch http://dl.google.com/linux/chrome/deb/dists/stable/InRelease Could not connect to 127.0.0.1:37337 (127.0.0.1). - connect (111: Connection refused)
W: Failed to fetch http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu/dists/xenial/InRelease Unable to connect to 127.0.0.1:37337:
W: Failed to fetch http://archive.ubuntukylin.com:10006/ubuntukylin/dists/xenial/InRelease Could not connect to 127.0.0.1:37337 (127.0.0.1). - connect (111: Connection refused)
W: Failed to fetch https://packages.microsoft.com/repos/vscode/dists/stable/InRelease Failed to connect to 127.0.0.1 port 37337: Connection refused
W: Some index files failed to download. They have been ignored, or old ones used instead.

4 13
1 method 1
https://blog.csdn.net/temotemo/article/details/79445694
2 method2
download tkinter bao install by myself
3 method3
caozuo zai python2.7 dan yinggai zai 3.5 xia suyi suoyi caozuo dou shi bai fei

Dense层,也被称为全连接层(Fully Connected Layer),是在深度学习神经网络中常见的一个组件。它接收前一层(通常是卷积层等)输出的特征映射,并将它们转化为更适用于分类任务或者其他下游任务的形式。 ### Dense 层的工作原理: 在Dense层中,每个节点(或称为神经元)都与前一层的所有节点相连,这意味着每一层中的节点都会对输入的每一个维度进行加权求和,然后应用激活函数(如ReLU、sigmoid或tanh等)得到输出。这种结构允许模型捕捉复杂的非线性关系。 ### Dense 层的特点: 1. **连接性**:Dense层的每一层的节点都直接与上一层所有节点相联接,这使得信息可以充分地在网络内部流动。 2. **非线性处理**:通过在每个节点应用激活函数,Dense层能够处理非线性的数据分布,并帮助模型学习到复杂模式。 3. **灵活性**:Dense层可以在任意深度的网络架构中加入,用于增加模型的表达能力。 4. **权重共享**:虽然理论上每个节点都有独立的权重值,但在实际操作中,这些权重会通过反向传播算法在整个网络中共同优化。 ### 使用Dense层的例子: 在构建图像分类模型时,最后的几层往往包括密集连接层,用于从特征图中提取最终的决策。例如,在构建一个基于卷积神经网络(CNN)的图片识别系统中,最后一层通常是一个全连接层,负责将所有先前层次的特征汇聚起来,形成最终的分类结果。 ### 注意事项: - **过拟合风险**:Dense层可能导致过拟合,尤其是当网络层数过多或训练集较小的时候。为了降低过拟合的风险,常用的技术包括正则化、dropout以及更多的数据增强策略。 - **计算成本**:由于每个节点都与其他所有节点连接,因此Dense层的计算量相对较大,特别是在有大量隐藏节点的情况下。 - **初始化和梯度消失/爆炸**:需要恰当的权重初始化策略,并监控梯度变化,以避免梯度消失或爆炸问题。 总之,Dense层是构建深度学习模型的关键组件之一,对于提高模型的性能至关重要。然而,也需要谨慎设计其参数,以避免潜在的问题,如过拟合和计算效率低下。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值