小编Tom*_*mas的帖子

恢复TensorFlow模型

我正在尝试恢复TensorFlow模型.我按照这个例子:http: //nasdag.github.io/blog/2016/01/19/classifying-bees-with-google-tensorflow/

在示例代码的末尾,我添加了以下行:

saver = tf.train.Saver()
save_path = saver.save(sess, "model.ckpt")
print("Model saved in file: %s" % save_path)
Run Code Online (Sandbox Code Playgroud)

创建了两个文件:checkpoint和model.ckpt.

在一个新的python文件(tomas_bees_predict.py)中,我有这个代码:

import tensorflow as tf

saver = tf.train.Saver()

with tf.Session() as sess:
  # Restore variables from disk.
  saver.restore(sess, "model.ckpt")
  print("Model restored.")
Run Code Online (Sandbox Code Playgroud)

但是,当我执行代码时,我收到此错误:

Traceback (most recent call last):
  File "tomas_bees_predict.py", line 3, in <module>
    saver = tf.train.Saver()
  File "/usr/local/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 705, in __init__
raise ValueError("No variables to save")
Run Code Online (Sandbox Code Playgroud)

ValueError:没有要保存的变量

有没有办法读取mode.ckpt文件,看看保存了哪些变量?或者有人可以帮助保存模型并根据上述示例进行恢复?

编辑1:

我想我尝试运行相同的代码,以重新创建模型结构,我收到了错误.我认为这可能与这里描述的代码没有使用命名变量的事实有关:http: //nasdag.github.io/blog/2016/01/19/classifying-bees-with-google-tensorflow/

def weight_variable(shape):
  initial = tf.truncated_normal(shape, stddev=0.1) …
Run Code Online (Sandbox Code Playgroud)

python tensorflow

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

CORS不适用于IE10中的cookie

我有使用CORS并设置cookie的GWT应用程序.它在Chrome,Firefox,Opera中运行良好,但在IE10(版本10.0.9200.16521)中我收到此错误:

SCRIPT5022: com.google.gwt.core.client.JavaScriptException: (InvalidStateError) 
 code: 11
 ABORT_ERR: 20
 DATA_CLONE_ERR: 25
 DOMSTRING_SIZE_ERR: 2
 HIERARCHY_REQUEST_ERR: 3
 INDEX_SIZE_ERR: 1
 INUSE_ATTRIBUTE_ERR: 10
 INVALID_ACCESS_ERR: 15
 INVALID_CHARACTER_ERR: 5
 INVALID_MODIFICATION_ERR: 13
 INVALID_NODE_TYPE_ERR: 24
 INVALID_STATE_ERR: 11
 NAMESPACE_ERR: 14
 NETWORK_ERR: 19
 NOT_FOUND_ERR: 8
 NOT_SUPPORTED_ERR: 9
 NO_DATA_ALLOWED_ERR: 6
 NO_MODIFICATION_ALLOWED_ERR: 7
 PARSE_ERR: 81
 QUOTA_EXCEEDED_ERR: 22
 SECURITY_ERR: 18
 SERIALIZE_ERR: 82
 SYNTAX_ERR: 12
 TIMEOUT_ERR: 23
 TYPE_MISMATCH_ERR: 17
 URL_MISMATCH_ERR: 21
 VALIDATION_ERR: 16
 WRONG_DOCUMENT_ERR: 4: InvalidStateError 
B3D7C8F35C000AA1ADFE700845710C1A.cache.html, line 1102 character 7
Run Code Online (Sandbox Code Playgroud)

我看到执行时会抛出错误:

xhr.withCredentials = true;
Run Code Online (Sandbox Code Playgroud)

这是GWT javascript代码:

function create_3(){
  var xhr;
  if ($wnd.XMLHttpRequest) {
    xhr …
Run Code Online (Sandbox Code Playgroud)

cookies gwt cors internet-explorer-9 internet-explorer-10

7
推荐指数
2
解决办法
8703
查看次数

启用远程JMX后,Cassandra"nodetool status"失败并显示"Credentials required"

我按照这些说明"启用JMX身份验证":

http://docs.datastax.com/en/cassandra/2.2/cassandra/configuration/secureJmxAuthentication.html

但是我遇到了这个问题:

nodetool status -u cassandra -pw cassandra 
error: Authentication failed! Credentials required
-- StackTrace --
java.lang.SecurityException: Authentication failed! Credentials required
    at com.sun.jmx.remote.security.JMXPluggableAuthenticator.authenticationFailure(JMXPluggableAuthenticator.java:211)
    at com.sun.jmx.remote.security.JMXPluggableAuthenticator.authenticate(JMXPluggableAuthenticator.java:163)
    at sun.management.jmxremote.ConnectorBootstrap$AccessFileCheckerAuthenticator.authenticate(ConnectorBootstrap.java:219)
    at javax.management.remote.rmi.RMIServerImpl.doNewClient(RMIServerImpl.java:232)
    at javax.management.remote.rmi.RMIServerImpl.newClient(RMIServerImpl.java:199)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:323)
    at sun.rmi.transport.Transport$1.run(Transport.java:200)
    at sun.rmi.transport.Transport$1.run(Transport.java:197)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$79(TCPTransport.java:683)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
    at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:276)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:253)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:162)
    at javax.management.remote.rmi.RMIServerImpl_Stub.newClient(Unknown Source)
    at javax.management.remote.rmi.RMIConnector.getConnection(RMIConnector.java:2432) …
Run Code Online (Sandbox Code Playgroud)

jmx cassandra

7
推荐指数
1
解决办法
3571
查看次数

Project Oxford Speech API的客户端ID

我想测试Microsoft Project Oxford语音识别API,但我不知道在哪里或如何获取client_id.

我正在尝试测试Search API.首先,我正在尝试获取令牌以使用该服务:

curl -d -i "https://oxford-speech.cloudapp.net/token/issueToken?grant_type=client_credentials&client_id=123&client_secret=456scope=https%3A%2F%2Fspeech.platform.bing.com"
{ "statusCode": 401, "message": "Access denied due to invalid subscription key. Make sure you are subscribed to an API you are trying to call and provide the right key." }
Run Code Online (Sandbox Code Playgroud)

我有主键和辅助键,但我找不到client_id.有人可以帮忙吗?

curl speech-recognition azure microsoft-cognitive

5
推荐指数
1
解决办法
2817
查看次数

计算MongoDB中的不同值

我尝试在MongoDB中计算不同的值,但我没有得到我期望的结果.

以下是数据示例:

{
        "_id" : ObjectId("55d354b0d5cec8aad571b8fe"),
        "version" : "0.4",
        "scan-time" : {
                "start" : 1439913109,
                "end" : 1439913136
        },
        "services" : [
                {
                        "service-type" : "SV1",
                        "service-version" : "V1",
                        "location" : {
                                "ipv4-address" : "192.168.1.1",
                                "protocol" : "tcp"
                        },
                        "classification-method" : "probed"
                },
                {
                        "service-type" : "SV1",
                        "service-version" : "V2",
                        "location" : {
                                "ipv4-address" : "192.168.1.2",
                                "protocol" : "tcp"
                        },
                        "classification-method" : "probed"
                },
                {
                        "location" : {
                                "ipv4-address" : "192.168.1.3",
                                "protocol" : "tcp"
                        },
                        "classification-method" : "probed",
                        "service-type" : …
Run Code Online (Sandbox Code Playgroud)

mongodb aggregation-framework

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