小编the*_*Kid的帖子

TensorFlow estimator.predict()给出警告:tensorflow:输入图不包含QueueRunner

我正在尝试使用自定义输入函数进行预测estimator.predict,但它给了我:

WARNING:tensorflow:Input graph does not contain a QueueRunner. That means predict yields forever. This is probably a mistake.

它没有给我一个错误,但predict只是说它的恢复参数并没有返回实际的预测.这是我的代码:

test_data = [0.03, 0.91, 0.95, 0.10, 0.56, 0.93]
test_data_in = { k: test_data[index] for index, k in enumerate(FEATURES) }
print(test_data_in)

def predict_input_fn(data_set):
    feature_cols = { k: tf.reshape(tf.constant(data_set[k], dtype=tf.float32), [-1]) for k in FEATURES }
    return feature_cols

predictions = estimator.predict(input_fn=lambda: predict_input_fn(test_data_in))
print(list(predictions))
Run Code Online (Sandbox Code Playgroud)

我看过这个问题,但是我找不到与我的问题相关的解决方案.为什么TensorFlow会显示此警告,如何摆脱它?

python machine-learning tensorflow

9
推荐指数
1
解决办法
1474
查看次数

Vue.js - 无法从方法访问计算属性

我在Vue组件中有一个使用firebase登录用户的登录方法.我使用的计算性能user,message以及hasErrors.当这个方法运行时,它进入catch函数,但是这个错误出现了: Uncaught TypeError: Cannot set property 'message' of undefined.我已经尝试直接更改vuex状态(因为这是计算的prop所做的),但这会产生相同的错误.这是我正在使用的方法:

login: function (event) {
  // ... more stuff
  // Sign-in the user with the email and password
  firebase.auth().signInWithEmailAndPassword(this.email, this.password)
    .then(function (data) {
      this.user = firebase.auth().currentUser
    }).catch(function (error) {
      this.message = error.message
      this.hasErrors = true
    })
  // ...
}
Run Code Online (Sandbox Code Playgroud)

这是计算的道具的样子:

message: {
  get () {
    return this.auth.message // mapState(['auth'])
  },
  set (value) {
    this.$store.commit('authMessage', value)
  }
}
Run Code Online (Sandbox Code Playgroud)

我很确定这个问题与它内部的问题有关Promise.那么如何在firebase中访问计算属性Promise呢?

javascript vue.js

6
推荐指数
1
解决办法
2751
查看次数

java中如何用\分割字符串?

我想分割特殊字符“\”。但是,使用它似乎不起作用

a.split("\");
Run Code Online (Sandbox Code Playgroud)

或者

a.split("\\");
Run Code Online (Sandbox Code Playgroud)

java split special-characters

4
推荐指数
1
解决办法
2386
查看次数

获取 JavaFX 图像的子图像以在 Canvas 上使用

我正在用 JavaFX 搞游戏编程,我为图形制作了一个 spritesheet。目前,我正在将 JavaFX 更改Image为 a BufferedImage,然后使用该BufferedImage#subImage函数获取子图像,然后使用SwingFXUtils将其更改回 JavaFX Image。我试图寻找一种更简单的方法,但还没有找到。他们是获取 JavaFX 子映像的更简单方法吗?

java javafx image javafx-8

2
推荐指数
1
解决办法
5718
查看次数