小编Sul*_*ade的帖子

使用python3.6进行Django迁移错误:root:找不到散列sha3_224的代码

您好我读了Django教程,我sha3_224在迁移过程中遇到了与特定哈希函数相关的错误.如何解决这个问题呢?谢谢.

(venv) linuxoid@linuxoid-ThinkPad-L540:~/myprojects/myproject$ python manage.py makemigrations
ERROR:root:code for hash sha3_224 was not found.
Traceback (most recent call last):
  File "/home/linuxoid/myprojects/venv/lib/python3.6/hashlib.py", line 121, in __get_openssl_constructor
    f = getattr(_hashlib, 'openssl_' + name)
AttributeError: module '_hashlib' has no attribute 'openssl_sha3_224'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/linuxoid/myprojects/venv/lib/python3.6/hashlib.py", line 243, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/home/linuxoid/myprojects/venv/lib/python3.6/hashlib.py", line 128, in __get_openssl_constructor
    return __get_builtin_constructor(name)
  File "/home/linuxoid/myprojects/venv/lib/python3.6/hashlib.py", line 113, in __get_builtin_constructor
    raise ValueError('unsupported …
Run Code Online (Sandbox Code Playgroud)

migration django models python-3.6

7
推荐指数
2
解决办法
3125
查看次数

如何在 AMD/ATI GPU 上运行 TensorFlow?

阅读本教程https://www.tensorflow.org/guide/using_gpu 后,我在这个简单的代码上检查了 GPU 会话

import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf

a = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2,3], name = 'a')
b = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape = [3,2], name =  'b')
c = tf.matmul(a, b)

with tf.Session(config=tf.ConfigProto(log_device_placement=True)) as sess:
    x = sess.run(c)
print(x)
Run Code Online (Sandbox Code Playgroud)

输出是

2018-08-07 18:44:59.019144:我 tensorflow/core/platform/cpu_feature_guard.cc:141] 您的 CPU 支持该 TensorFlow 二进制文件未编译使用的指令:AVX2 FMA 设备映射:没有已知设备。2018-08-07 18:44:59.019536: I tensorflow/core/common_runtime/direct_session.cc:288] 设备映射:

MatMul: (MatMul): /job:localhost/replica:0/task:0/device:CPU:0 2018-08-07 18:44:59.019902: I tensorflow/core/common_runtime/placer.cc:886] MatMul: (MatMul)/job:localhost/replica:0/task:0/device:CPU:0 …

gpu amd tensorflow

6
推荐指数
2
解决办法
5779
查看次数

在 Keras 中将 LSTM 与具有不同张量维度的 CNN 连接起来

这是我尝试使用连接操作合并的两个神经元网络。网络应按 1-好电影和 0-坏电影对 IMDB 电影评论进行分类

def cnn_lstm_merged():
       embedding_vecor_length = 32
       cnn_model = Sequential()
       cnn_model.add(Embedding(top_words, embedding_vecor_length, input_length=max_review_length))
       cnn_model.add(Conv1D(filters=32, kernel_size=3, padding='same', activation='relu'))
       cnn_model.add(MaxPooling1D(pool_size=2))
       cnn_model.add(Flatten())

       lstm_model = Sequential()
       lstm_model.add(Embedding(top_words, embedding_vecor_length, input_length=max_review_length))
       lstm_model.add(LSTM(64, activation = 'relu'))
       lstm_model.add(Flatten())

       merge = concatenate([lstm_model, cnn_model])
       hidden = (Dense(1, activation = 'sigmoid'))(merge)
       #print(model.summary())
       output = hidden.fit(X_train, y_train, epochs=3, batch_size=64)
       return output
Run Code Online (Sandbox Code Playgroud)

但是当我运行代码时出现错误:

  File "/home/pythonist/Desktop/EnsemblingLSTM_CONV/train.py", line 59, in cnn_lstm_merged
    lstm_model.add(Flatten())
  File "/home/pythonist/deeplearningenv/lib/python3.6/site-packages/keras/engine/sequential.py", line 185, in add
    output_tensor = layer(self.outputs[0])
  File "/home/pythonist/deeplearningenv/lib/python3.6/site-packages/keras/engine/base_layer.py", line 414, in __call__
    self.assert_input_compatibility(inputs)
  File "/home/pythonist/deeplearningenv/lib/python3.6/site-packages/keras/engine/base_layer.py", line 327, …
Run Code Online (Sandbox Code Playgroud)

python deep-learning conv-neural-network lstm keras

3
推荐指数
1
解决办法
4409
查看次数