tensorflow

Tensorflow compatibility with Keras

淺唱寂寞╮ 提交于 2021-02-20 18:47:00
问题 I am using Python 3.6 and Tensorflow 2.0, and have some Keras codes: import keras from keras.models import Sequential from keras.layers import Dense model = Sequential() model.add(Dense(1)) model.compile(optimizer='adam',loss='mean_squared_error',metrics=['accuracy']) However I got the error: "Keras requires TensorFlow 2.2 or higher. Install TensorFlow via pip install tensorflow " when trying to run it. I checked on https://keras.io/, it says Keras was built on Tensorflow 2.0. So I am

Ubuntu 16.04 安装显卡驱动后循环登录和无法设置分辨率的一种解决方案

大憨熊 提交于 2021-02-20 12:59:37
1. 安装环境 电脑:MSI GP63 显卡:GeForce GTX 1070 系统:Ubuntu 16.04 驱动版本:NVIDIA 384.130 2. 循环登录 如果按照这篇文章 Ubuntu 16.04 安装 CUDA、CUDNN 和 GPU 版本的 TensorFlow 一般步骤总结 中说的直接在设置中安装驱动的话,就会遇到在登录界面循环登录的问题。 于是我们转而利用从官网下载的 run 文件来安装,而驱动的版本则选择和在设置中附加驱动里看到的一样。 在 BIOS 里面关闭快速启动和安全启动 进入 Ubuntu 系统,Ctrl+Alt+F1 进入 tty1 模式 输入用户名和密码进行登录 关闭图形界面 sudo service lightdm stop 给 run 文件赋予执行权限 sudo chmod +x NVIDIA*.run (代表下载的安装文件) sudo ./NVIDIA*.run -no-x-check -no-nouveau-check -no-opengl-files 中间有警告的话选继续安装,不认证 打开图形界面 sudo service lightdm start 重启 按照这个方法安装驱动后可以正常登录进系统,运行 nvidia-smi 命令也可以看到显卡信息,但在设置中依然只有一个 800*600 的分辨率选项。 3. 无法设置分辨率 具体表现

Items of feature_columns must be a _FeatureColumn

心已入冬 提交于 2021-02-20 12:01:13
问题 I am getting this error: ValueError: Items of feature_columns must be a _FeatureColumn. Given (type ): Index(['CreditScore', 'Age', 'Tenure', 'Balance', 'NumOfProducts', 'HasCrCard', 'IsActiveMember', 'EstimatedSalary', 'Exited'], dtype='object'). I am using tensorFlow lib. I want to get prediction results but I can not run m.train(input_fn=get_input_fn ,steps=5000) code. I always got the same error whatever I did. I used these input functions in the following but nothing changed. def input

Errors when training my saved tensorflow model

与世无争的帅哥 提交于 2021-02-20 05:14:28
问题 I'm trying to build a custom keras model whith the subclassing API but I get some errors when I load a previous instance of my model and I try to train it : Here is the class of my model, it has 3 inputs and 1 output : import tensorflow as tf spec1 = tf.TensorSpec(shape=(1,40,5,1)) spec2 = tf.TensorSpec(shape=(1,3)) class Conv_Rnn_model(tf.keras.Model): def __init__(self): # super() permet d'appeler le constructeur de la classe mère dans la classe fille # permet égalemet de résoudre le

Errors when training my saved tensorflow model

∥☆過路亽.° 提交于 2021-02-20 05:14:25
问题 I'm trying to build a custom keras model whith the subclassing API but I get some errors when I load a previous instance of my model and I try to train it : Here is the class of my model, it has 3 inputs and 1 output : import tensorflow as tf spec1 = tf.TensorSpec(shape=(1,40,5,1)) spec2 = tf.TensorSpec(shape=(1,3)) class Conv_Rnn_model(tf.keras.Model): def __init__(self): # super() permet d'appeler le constructeur de la classe mère dans la classe fille # permet égalemet de résoudre le

Errors when training my saved tensorflow model

两盒软妹~` 提交于 2021-02-20 05:12:51
问题 I'm trying to build a custom keras model whith the subclassing API but I get some errors when I load a previous instance of my model and I try to train it : Here is the class of my model, it has 3 inputs and 1 output : import tensorflow as tf spec1 = tf.TensorSpec(shape=(1,40,5,1)) spec2 = tf.TensorSpec(shape=(1,3)) class Conv_Rnn_model(tf.keras.Model): def __init__(self): # super() permet d'appeler le constructeur de la classe mère dans la classe fille # permet égalemet de résoudre le

Errors when training my saved tensorflow model

浪尽此生 提交于 2021-02-20 05:12:42
问题 I'm trying to build a custom keras model whith the subclassing API but I get some errors when I load a previous instance of my model and I try to train it : Here is the class of my model, it has 3 inputs and 1 output : import tensorflow as tf spec1 = tf.TensorSpec(shape=(1,40,5,1)) spec2 = tf.TensorSpec(shape=(1,3)) class Conv_Rnn_model(tf.keras.Model): def __init__(self): # super() permet d'appeler le constructeur de la classe mère dans la classe fille # permet égalemet de résoudre le

how can I overcome “ValueError: Shapes (None, 1) and (None, 7) are incompatible”

天大地大妈咪最大 提交于 2021-02-20 04:24:27
问题 I am new to Keras and CNN. I am working on an assignment to build a CNN for predicting face emotions. I built the model as per the assignment but while compiling the model I get "ValueError: Shapes (None, 1) and (None, 7) are incompatible". Can someone help me how to resolve this? Pasting my code below for reference: ''' model = Sequential() model.add(Conv2D(filters = 64, kernel_size = 5,input_shape = (48,48,1))) model.add(Conv2D(filters=64, kernel_size=5,strides=(1, 1), padding='valid'))

Compare tf.string and python string

本秂侑毒 提交于 2021-02-20 03:49:41
问题 How can I compare a Tensorflow string tensor to a python string type. I tried something like this if(tf.constant("neg",tf.string) in key): a=True key here, is a tf.string. I want to see if 'neg' is in the key tensor. 回答1: Unfortunately, currently you cannot. Please ask this on TF github in issues section. 来源: https://stackoverflow.com/questions/35946810/compare-tf-string-and-python-string

Compare tf.string and python string

≯℡__Kan透↙ 提交于 2021-02-20 03:43:45
问题 How can I compare a Tensorflow string tensor to a python string type. I tried something like this if(tf.constant("neg",tf.string) in key): a=True key here, is a tf.string. I want to see if 'neg' is in the key tensor. 回答1: Unfortunately, currently you cannot. Please ask this on TF github in issues section. 来源: https://stackoverflow.com/questions/35946810/compare-tf-string-and-python-string