我试图评估我的模型时遇到以下错误.
tensorflow.python.framework.errors.InvalidArgumentError: Minimum tensor rank: 1 but got: 1 [[Node: ArgMax_1 = ArgMax[T=DT_INT64, _device="/job:localhost/replica:0/task:0/cpu:0"](_recv_Placeholder_1_0, ArgMax_1/dimension/_40)]]
这是相关的代码
# Predictions for the current training minibatch.
train_prediction = tf.nn.softmax(logits)
correct_prediction = tf.equal(tf.argmax(train_prediction, 1), tf.argmax(train_labels, 1))
accuracy = tf.reduce_mean(tf.cast(correct_prediction, tf.float32))
sess.run(tf.initialize_all_variables())
for i in range(1000000):
start_time = time()
images, labels = get_batch(fifo_queue, FLAGS.batch_size)
feed_dict = {
train_images: images,
train_labels: labels
}
_, loss_value, learn_rate, predictions = sess.run(
[train_step, cross_entropy, learning_rate, train_prediction],
feed_dict=feed_dict)
duration = time() - start_time
if i % 1 == 0:
# …Run Code Online (Sandbox Code Playgroud) 我正在为电源插座创建分类器(特别是在标准插座面板上出现两次的三个开孔,而不是整个面板本身)。
我的问题是,正图像的理想特征是什么,我应该将什么宽度和高度传递给 train_cascade 以使我的对象检测器能够检测到尽可能小的出口?即从尽可能远的距离检测它们?我也关心准确性,并且对需要数周时间训练的分类器很好(假设它实际上正在取得进展)。
还有一个问题来增加我对此的理解:我传递给train_cascade搜索框的尺寸的宽度和高度是否会传递到每个图像上?如果是这样,我希望我的探测器检测到非常小的物体,而不是我应该通过一个小的宽度和高度,对吗?
我希望能够检测非常大和非常小的插座实例。从非常近的地方(相机实际上距离插座 3 英寸)到至少几英尺远。
我正在尝试使用带有nodejs的cheerio.js来获取XBRL条目的文本(在本例中为'10 -Q').该行如下:
<dei:DocumentType contextRef="D2013Q3YTD" id="Fact-DB2A50C2A485F9CC21D51934C6E61D42">10-Q</dei:DocumentType>
Run Code Online (Sandbox Code Playgroud)
我试过了:
$('dei:DocumentType').text
Run Code Online (Sandbox Code Playgroud)
和其他一些无济于事.我没有看到唯一的ID或其他任何内容.
样本文件:
http://www.sec.gov/Archives/edgar/data/1018724/000144530513002495/amzn-20130930.xml
Run Code Online (Sandbox Code Playgroud)
那么我怎么能去提取这个文本呢?谢谢.
我正在尝试从Yahoo财务网址获取结果:
http://finance.yahoo.com/d/quotes.csv?s=XOM=sn1yr ,它返回:
"XOM",4:00pm - <b>83.25`</b>`,2.11,13.42
Run Code Online (Sandbox Code Playgroud)
我正在尝试使用Mongoose将这些结果存储在数据库中。我有一些代码可以从现有CSV文件中保存(您可以看到不同但相关的内容):
var writer = new csv.CsvWriter(process.stdout);
reader.setColumnNames(["Symbol","Company","StockExchange"]);
reader.addListener('data', function(data) {
console.log(data);
var stock = new Stock(data).save();
});
Run Code Online (Sandbox Code Playgroud)
我正在尝试做类似的事情:
Scraper是位于https://github.com/mape/node-scraper的模块
scraper('http://search.twitter.com/search?q=javascript', function(err, $) {
if (err) {throw err;}
$('.msg').each(function() {
console.log($(this).text().trim()+'\n');
});
});
Run Code Online (Sandbox Code Playgroud)
但使用Yahoo URL的CSV结果却没有将响应放入单独的CSV文件中,并被告知我需要以某种方式使用stream.write。我是Node的新手,希望能帮助您解决这个问题。在此先感谢您的帮助!
cheerio ×1
csv ×1
javascript ×1
node.js ×1
opencv ×1
parsing ×1
regex ×1
scrape ×1
tensorflow ×1
viola-jones ×1
xbrl ×1