我正在尝试将一个非常大的数据集(在ndarray中大约28GB的RAM)分配到theano共享变量中,使用borrow = True来避免复制内存.为此,我使用以下功能:
def load_dataset(path):
# Load dataset from memory
data_f = np.load(path+'train_f.npy')
data_t = np.load(path+'train_t.npy')
# Split into training and validation
return (
(
theano.shared(data_f[:-1000, :], borrow=True),
theano.shared(data_t[:-1000, :], borrow=True)
), (
theano.shared(data_f[-1000:, :], borrow=True),
theano.shared(data_t[-1000:, :], borrow=True)
)
)
Run Code Online (Sandbox Code Playgroud)
为了避免数据转换,在将阵列保存到磁盘之前,我已经将它们定义为正确的格式(之后填充它们并使用np.save()将它们转储到磁盘中):
data_f = np.ndarray((len(rows), 250*250*3), dtype=theano.config.floatX)
data_t = np.ndarray((len(rows), 1), dtype=theano.config.floatX)
Run Code Online (Sandbox Code Playgroud)
但是,似乎theano厌倦了复制内存,抛弃了以下错误:
分配25594500000字节的设备内存时出错(内存不足).驱动程序报告3775729664字节空闲,总计4294639616字节.
Theano配置为在GPU(GTX 970)上运行.
我试图获得相对于身体的鼠标位置(即身体=坐标原点)为一个网站,它的身体元素大小固定,并使用margin:auto CSS属性居中.
由于event.clientX和event.clientY属性给出了从页面开头的偏移量,而不是从body元素,我试图将它减去身体偏移量.为此,我尝试使用document.body.offsetLeft和document.body.offsetTop,但到目前为止没有运气,该值未定义.此外,由于我没有定义它,我不能使用document.body.style.left或document.body.style.top.
有人知道一种获取身体偏移的方法或直接获取相对于DOM元素的鼠标坐标吗?
先感谢您!
随着 tf.contrib 模块从 Tensorflow 中消失,并且 tf.train.Saver() 也消失了,我找不到一种方法来存储一组嵌入及其相应的缩略图,以便 Tensorboard Projector 可以读取它们。
Tensorflow 2.0的Tensorboard 文档解释了如何创建绘图和摘要,以及如何使用摘要工具,但没有介绍投影仪工具。有没有人发现如何存储数据集以进行可视化?
如果可能的话,我希望有一个(最小的)代码示例。
bigdata ×1
dom ×1
javascript ×1
mouseevent ×1
python-2.7 ×1
python-3.x ×1
tensorboard ×1
tensorflow ×1
theano ×1