在Ubuntu 14.04上使用GPU安装TensorFlow.对于Ubuntu/UNIX环境来说相当新,所以很多东西我都没有.在搜索此问题时,我遇到了在安装了CUDA 7.5时无法导入CUDA 7.0的实例(因为TensorFlow不支持7.5).我安装了CUDA 7.0,但它似乎在寻找7.5 - 这是为什么?我在.bashrc文件中有以下几行:
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda-7.0/lib64"
export CUDA_HOME=/usr/local/cuda-7.0
Run Code Online (Sandbox Code Playgroud)
但我仍然看到下面的问题......任何人都有任何建议吗?
>>> import tensorflow as tf
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/ford/tensorflow/local/lib/python2.7/site-packages/tensorflow/__init__.py", line 23, in <module>
from tensorflow.python import *
File "/home/ford/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/__init__.py", line 49, in <module>
from tensorflow import contrib
File "/home/ford/tensorflow/local/lib/python2.7/site-packages/tensorflow/contrib/__init__.py", line 23, in <module>
from tensorflow.contrib import layers
File "/home/ford/tensorflow/local/lib/python2.7/site-packages/tensorflow/contrib/layers/__init__.py", line 68, in <module>
from tensorflow.contrib.layers.python.layers import *
File "/home/ford/tensorflow/local/lib/python2.7/site-packages/tensorflow/contrib/layers/python/layers/__init__.py", line 22, in <module>
from tensorflow.contrib.layers.python.layers.initializers import *
File "/home/ford/tensorflow/local/lib/python2.7/site-packages/tensorflow/contrib/layers/python/layers/initializers.py", …Run Code Online (Sandbox Code Playgroud) 我正在使用一个非常简单的示例。我在同一组轴上创建了三个散点图,我绘制的每个数据集都有一个不同的关联颜色图。然而,传说并不像我想要的那样;为什么是这样?
import numpy as np
import matplotlib.pyplot as plt
t = np.linspace(0,10,100)
x = np.random.rand(100,3)
y = np.random.rand(100,3)
colmaps = ['Blues', 'Greys', 'Reds']
for i in range(3):
plt.scatter(x[:,i], y[:,i], c=t, cmap=colmaps[i], label=i)
plt.legend()
plt.show()
Run Code Online (Sandbox Code Playgroud)
这会产生如下图:

我希望第一个标签是蓝色的,第二个是灰色的,第三个是红色的,所以它们与颜色图相关联,但看起来它不是这样工作的。有没有一种简单的方法可以做到这一点?
谢谢
首先,这里是我的应用程序目前的链接:ds http://i50.tinypic.com/30skom0.jpg
在显示的两个图表中,我想摆脱条形图左边的边距.有任何想法吗?
以下是我的渲染器设置.我搜索过,无法找到有类似问题的人.看起来应该很简单......
private void drawBarChart(XYMultipleSeriesDataset dataset) {
int marginT = 10;
int marginL = 5;
int marginB = 10;
int marginR = 5;
int[] margins = {marginT, marginL, marginB, marginR};
...
XYMultipleSeriesRenderer renderer = buildBarRenderer(colors);
renderer.setOrientation(Orientation.VERTICAL);
renderer.getSeriesRendererAt(0).setDisplayChartValues(false);
renderer.getSeriesRendererAt(1).setDisplayChartValues(false);
renderer.getSeriesRendererAt(2).setDisplayChartValues(false);
renderer.setLabelsColor(Color.LTGRAY);
renderer.setAxesColor(Color.BLACK);
renderer.setYAxisMin(0);
renderer.setMargins(margins);
renderer.setYAxisMax(maxYVal);
renderer.setYLabels(0);
renderer.setXLabels(0);
renderer.setXAxisMin(0);
renderer.setXAxisMax(2);
renderer.setZoomEnabled(false,false);
renderer.setPanEnabled(false, false);
renderer.setBarSpacing(-0.5);
renderer.setShowAxes(false);
renderer.setShowLabels(false);
renderer.setShowLegend(false);
...
display chart in view
}
protected XYMultipleSeriesRenderer buildBarRenderer(int[] colors) {
XYMultipleSeriesRenderer renderer = new XYMultipleSeriesRenderer();
int length = colors.length;
for (int …Run Code Online (Sandbox Code Playgroud) achartengine ×1
android ×1
bar-chart ×1
legend ×1
margins ×1
matplotlib ×1
python ×1
scatter-plot ×1
tensorflow ×1
ubuntu ×1