tensorflow

Tensorflow: docker image and -gpu suffix

為{幸葍}努か 提交于 2020-12-06 03:36:17
问题 In the Docker image for Tensorflow with GPU support (for example: tensorflow/tensorflow:2.2.0-gpu ) the installed python package is tensorflow-gpu (as shown in pip freeze ). Installing any python package that depends on tensorflow triggers the installation of tensorflow itself, although it's already installed under a different name (because -- correctly -- tensorflow-gpu != tensorflow ). Is there a way to avoid this? 回答1: You can add an instruction to install a fake tensorflow "package" that

Tensorflow: docker image and -gpu suffix

安稳与你 提交于 2020-12-06 03:36:12
问题 In the Docker image for Tensorflow with GPU support (for example: tensorflow/tensorflow:2.2.0-gpu ) the installed python package is tensorflow-gpu (as shown in pip freeze ). Installing any python package that depends on tensorflow triggers the installation of tensorflow itself, although it's already installed under a different name (because -- correctly -- tensorflow-gpu != tensorflow ). Is there a way to avoid this? 回答1: You can add an instruction to install a fake tensorflow "package" that

TensorFlow学习笔记4-线性代数基础

心已入冬 提交于 2020-12-06 03:05:00
TensorFlow学习笔记4-线性代数基础 本笔记内容为“AI深度学习”。内容主要参考《Deep Learning》中文版。 $X$表示训练集的设计矩阵,其大小为m行n列,m表示训练集的大小(size),n表示特征的个数; $W$表示权重矩阵,其大小是n行k列,n为输入特征的个数,k为输出(特征)的个数; $\boldsymbol{y}$表示训练集对应标签,其大小为m行,m表示训练集的大小(size); $\boldsymbol{y’}$表示将测试向量$x$输入后得到的测试结果; 几个概念 深度学习 如果想让计算机构建较简单的概念来学习复杂概念,我们可能需要一个深的(层次很多的)计算图,这种方法叫做 AI深度学习 。典型例子是 前馈神经网络 和 多层感知机(multilayer perceptron, MLP) 。 神经网络的 深度 的度量: 计算图的深度(计算层次) 概念图的深度(模型层次) 深度学习、机器学习与AI的关系如图: 表示学习 机器学习 需要特征集,但我们很难知道应提取什么特征。如:我们想识别出图片中是否有汽车,想到用车轮是否存在作为一个特征,但如何根据像素值去描述什么是车轮呢?这就需要 表示学习 。 表示学习 可帮助发现很好的特征集。 自编码器 表示学习 的典例是 自编码器 (autoencoder)。它希望: 输入数据$X$和输出数据$X’$尽可能保持一致;

Unable to install tensorflow using conda with python 3.8

北战南征 提交于 2020-12-06 00:49:32
问题 Recently, I upgraded to Anaconda3 2020.07 which uses python 3.8. In past versions of anaconda, tensorflow was installed successfully. Tensorflow failed to be installed successfully in this version. I ran the command below; conda install tensorflow-gpu The error message that I received is shown below; UnsatisfiableError: The following specifications were found to be incompatible with the existing python installation in your environment: Specifications: - tensorflow-gpu -> python[version='3.5.*

《Python与机器学习实战》笔记+源码

白昼怎懂夜的黑 提交于 2020-12-05 19:46:38
向AI转型的程序员都关注了这个号 👇👇👇 机器学习AI算法工程 公众号:datayx Python与机器学习这一话题是如此的宽广,仅靠一本书自然不可能涵盖到方方面面,甚至即使出一个系列的书也难能做到这点。单就机器学习而言,其领域就包括但不限于如下:有监督学习(Supervised Learning),无监督学习(Unsupervised Learning)和半监督学习(Semi-Supervised Learning)。而其具体的问题又大致可以分为两类:分类问题(Classification)和回归问题(Regression)。 Python本身带有许多机器学习的第三方库,但《Python与机器学习实战:决策树、集成学习、支持向量机与神经网络算法详解及编程实现》在绝大多数情况下只会用到Numpy这个基础的科学计算库来进行算法代码的实现。这样做的目的是希望读者能够从实现的过程中更好地理解机器学习算法的细节,以及了解Numpy的各种应用。不过作为补充,《Python与机器学习实战:决策树、集成学习、支持向量机与神经网络算法详解及编程实现》会在适当的时候应用scikit-learn这个成熟的第三方库中的模型。 《Python与机器学习实战:决策树、集成学习、支持向量机与神经网络算法详解及编程实现》适用于想了解传统机器学习算法的学生和从业者,想知道如何高效实现机器学习算法的程序员

Angular typescript typecheck issues when importing tensorflow in web worker

我是研究僧i 提交于 2020-12-05 11:44:16
问题 I am trying to use tensorflow/tfjs (TF) in a web-worker in an angular project. Creating a web-worker using the ng generate worker command works just fine. Importing TF in a component is fine too. However importing TF in the worker i.e. : import * as tf from '@tensorflow/tfjs' Generates a bunch of missing definition errors when building through the ng build command. Missing types are typically DOM-related types such as error TS2304: Cannot find name ImageData | HTMLImageElement |

Keras seems to hang after call to fit_generator

自作多情 提交于 2020-12-05 11:10:31
问题 I am trying to fit the Keras implementation of the SqueezeDet model to a new dataset. After making the appropriate changes to my config file, I tried to run the train script, but it seems to hang after the call to fit_generator() . As I get the following output: /anaconda/envs/py35/lib/python3.5/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype

Keras seems to hang after call to fit_generator

百般思念 提交于 2020-12-05 11:09:29
问题 I am trying to fit the Keras implementation of the SqueezeDet model to a new dataset. After making the appropriate changes to my config file, I tried to run the train script, but it seems to hang after the call to fit_generator() . As I get the following output: /anaconda/envs/py35/lib/python3.5/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype

deepfm tensorflow 模型导出

﹥>﹥吖頭↗ 提交于 2020-12-05 10:11:05
添加name with tf.name_scope("output"): self.out = tf.add(tf.matmul(concat_input, self.weights["concat_projection"]), self.weights["concat_bias"]) if self.loss_type == "logloss": self.out = tf.nn.sigmoid(self.out, name="predictlabel") 训练模型,得到模型文件 导出pd,新建model.py(跟模型在同一文件夹下) from tensorflow.python import pywrap_tensorflow import tensorflow as tf from tensorflow.python.framework import graph_util def getAllNodes(checkpoint_path): reader = pywrap_tensorflow.NewCheckpointReader(checkpoint_path) var_to_shape_map = reader.get_variable_to_shape_map() # Print tensor name and values for key in var_to

yolo3训练时CUDA Error: out of memory问题的解决

你离开我真会死。 提交于 2020-12-05 07:55:24
1.CUDA Error: out of memory darknet: ./src/cuda.c:36: check_error: Assertio `0' failed. 需要修改所使用的模型cfg文件中的subdivision的参数。 由subdivisions=8改成subdivisions=64。 subdivision: 这个参数很有意思的,它会让你的每一个batch不是一下子都丢到网络里。而是分成subdivision对应数字的份数,一份一份的跑完后,在一起打包算作完成一次iteration。这样会降低对显存的占用情况。如果设置这个参数为1的话就是一次性把所有batch的图片都丢到网络里,如果为2的话就是一次丢一半。 http://blog.csdn.net/renhanchi/article/details/71077830?locationNum=11&fps… 若上述方法不能解决: 导致cuda真正的原因是: 大致意思就是 服务器的GPU大小为M tensorflow只能申请N(N<M) 也就是tensorflow告诉你 不能申请到GPU的全部资源 然后就不干了 解决方法: 找到代码中Session 在session定义前 增加 config = tf.ConfigProto(allow_soft_placement=True) #最多占gpu资源的70%