相关疑难解决方法(0)

导入matplotlib.pyplot时出错(在适用于Windows 10 Home 64位PC的Anaconda3上)

我最近在我的Windows 10 Home(64位)机器上安装了"Anaconda3 for Windows v2.4.0".

(我从https://www.continuum.io/downloads下载了Windows 64位图形安装程序"Anaconda3-2.4.0-Windows-x86_64.exe"(392 MB).)

在命令提示符窗口中,我做了conda"Test Drive",包括"conda update conda"等.最后,我看到以下内容:

C:\Users\Anshul\Downloads\Python>conda update conda
Fetching package metadata: ....
# All requested packages already installed.
# packages in environment at C:\Anaconda3:
#
conda                     3.18.6                   py35_0    defaults

C:\Users\Anshul\Downloads\Python>conda list matplotlib
# packages in environment at C:\Anaconda3:
#
matplotlib                1.5.0               np110py35_0    defaults
Run Code Online (Sandbox Code Playgroud)

安装似乎已经成功 - 例如:

C:\Users\Anshul\Downloads\Python>python
Python 3.5.0 |Anaconda 2.4.0 (64-bit)| (default, Nov  7 2015, 13:15:24) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" …
Run Code Online (Sandbox Code Playgroud)

windows matplotlib python-3.x

18
推荐指数
1
解决办法
1万
查看次数

如何列出节点所依赖的所有Tensorflow变量?

如何列出节点所依赖的所有Tensorflow变量/常量/占位符?

示例1(添加常量):

import tensorflow as tf

a = tf.constant(1, name = 'a')
b = tf.constant(3, name = 'b')
c = tf.constant(9, name = 'c')
d = tf.add(a, b, name='d')
e = tf.add(d, c, name='e')

sess = tf.Session()
print(sess.run([d, e]))
Run Code Online (Sandbox Code Playgroud)

我想有一个功能list_dependencies(),如:

  • list_dependencies(d) 回报 ['a', 'b']
  • list_dependencies(e) 回报 ['a', 'b', 'c']

示例2(占位符和权重矩阵之间的矩阵乘法,然后添加偏差向量):

tf.set_random_seed(1)
input_size  = 5
output_size = 3
input       = tf.placeholder(tf.float32, shape=[1, input_size], name='input')
W           = tf.get_variable(
                "W",
                shape=[input_size, output_size],
                initializer=tf.contrib.layers.xavier_initializer())
b           = tf.get_variable(
                "b",
                shape=[output_size],
                initializer=tf.constant_initializer(2))
output      = …
Run Code Online (Sandbox Code Playgroud)

python tensorflow

13
推荐指数
1
解决办法
3899
查看次数

标签 统计

matplotlib ×1

python ×1

python-3.x ×1

tensorflow ×1

windows ×1