Tensorflow训练模型适用于云计算机,但在我的本地计算机

时间:2017-12-24 23:52:40

标签: python tensorflow machine-learning deep-learning

我已尝试在paperspace云桌面中创建自定义对象检测器,然后我在Jupyter Notebook上尝试了它并且它可以正常工作。

现在,我已经上传了整个models-master文件夹并将其下载到我的本地计算机上。

我使用Jupyter Notebook运行它,它现在提供InvalidArgumentError。我尝试使用在云上训练的相同ckpt重新导出本地计算机上的推理图,但它仍无法正常工作。

  

InvalidArgumentError Traceback(最近一次调用   持续)   /usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py   在_do_call(self,fn,* args)1322尝试:    - > 1323返回fn(* args)1324除了errors.OpError为e:

     

/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py   在_run_fn(session,feed_dict,fetch_list,target_list,options,   run_metadata)1301 feed_dict,   fetch_list,target_list,    - > 1302 status,run_metadata)1303

     

/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/errors_impl.py   在退出(self,type_arg,value_arg,traceback_arg)       472 compat.as_text(c_api.TF_Message(self.status.status)),    - > 473 c_api.TF_GetCode(self.status.status))       474#从内存中删除基础状态对象,否则它将保持活动状态

     

InvalidArgumentError:NodeDef提及attr' T'不在Op索引中:int64&gt ;; NodeDef:   后处理/ BatchMultiClassNonMaxSuppression /地图/时/ MultiClassNonMaxSuppression / FilterGreaterThan /在哪里   = WhereT = DT_BOOL,_device =" / job:localhost / replica:0 / task:0 / device:GPU:0"。   (检查您的GraphDef解释二进制文件是否是最新的   你的GraphDef生成二进制文件。)。 [[节点:   后处理/ BatchMultiClassNonMaxSuppression /地图/时/ MultiClassNonMaxSuppression / FilterGreaterThan /在哪里   = WhereT = DT_BOOL,_device =" / job:localhost / replica:0 / task:0 / device:GPU:0"]]

     

在处理上述异常期间,发生了另一个异常:

     

InvalidArgumentError Traceback(最近一次调用   最后)in()        20(盒子,分数,类,数量)= sess.run(        21 [detection_boxes,detection_scores,detection_classes,num_detections],   ---> 22 feed_dict = {image_tensor:image_np_expanded})        23#可视化检测结果。        24 vis_util.visualize_boxes_and_labels_on_image_array(

     

/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py   在运行中(self,fetches,feed_dict,options,run_metadata)       887尝试:       888 result = self._run(None,fetches,feed_dict,options_ptr,    - > 889 run_metadata_ptr)       890如果run_metadata:       891 proto_data = tf_session.TF_GetBuffer(run_metadata_ptr)

     

/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py   在_run中(self,handle,fetches,feed_dict,options,run_metadata)
  1118如果是final_fetches或final_targets或(句柄和   feed_dict_tensor):1119结果= self._do_run(句柄,   final_targets,final_fetches,    - > 1120 feed_dict_tensor,options,run_metadata)1121 else:1122 results = []

     

/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py   在_do_run中(self,handle,target_list,fetch_list,feed_dict,options,   run_metadata)1315如果句柄为无:1316返回   self._do_call(_ run_fn,self._session,feeds,fetches,targets,    - > 1317选项,run_metadata)1318 else:1319返回self._do_call(_prun_fn,self._session,   处理,提要,提取)

     

/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py   在_do_call(self,fn,* args)1334中除了KeyError:1335   通过    - > 1336引发类型(e)(node_def,op,message)1337 1338 def _extend_graph(self):

     

InvalidArgumentError:NodeDef提及attr' T'不在Op索引中:int64&gt ;; NodeDef:   后处理/ BatchMultiClassNonMaxSuppression /地图/时/ MultiClassNonMaxSuppression / FilterGreaterThan /在哪里   = WhereT = DT_BOOL,_device =" / job:localhost / replica:0 / task:0 / device:GPU:0"。   (检查您的GraphDef解释二进制文件是否是最新的   你的GraphDef生成二进制文件。)。 [[节点:   后处理/ BatchMultiClassNonMaxSuppression /地图/时/ MultiClassNonMaxSuppression / FilterGreaterThan /在哪里   = WhereT = DT_BOOL,_device =" / job:localhost / replica:0 / task:0 / device:GPU:0"]]

     

由op引起   '后处理器/ BatchMultiClassNonMaxSuppression /图/同时/ MultiClassNonMaxSuppression / FilterGreaterThan /凡&#39 ;,   定义于:File" /usr/lib/python3.5/runpy.py" ;,第184行,in   _run_module_as_main       " main ",mod_spec)文件" /usr/lib/python3.5/runpy.py",第85行,在_run_code中       exec(code,run_globals)File" /home/ryan/.local/lib/python3.5/site-packages/ipykernel_launcher.py",   第16行,在       app.launch_new_instance()文件" /home/ryan/.local/lib/python3.5/site-packages/traitlets/config/application.py",   第658行,在launch_instance中       app.start()File" /home/ryan/.local/lib/python3.5/site-packages/ipykernel/kernelapp.py",   第477行,开始       ioloop.IOLoop.instance()。start()File" /home/ryan/.local/lib/python3.5/site-packages/zmq/eventloop/ioloop.py",   第177行,开始       super(ZMQIOLoop,self).start()File" /home/ryan/.local/lib/python3.5/site-packages/tornado/ioloop.py",   第888行,开始       handler_func(fd_obj,events)File" /home/ryan/.local/lib/python3.5/site-packages/tornado/stack_context.py",   第277行,在null_wrapper中       return fn(* args,** kwargs)File" /home/ryan/.local/lib/python3.5/site-packages/zmq/eventloop/zmqstream.py",   第_ 440行,在_handle_events中       self._handle_recv()File" /home/ryan/.local/lib/python3.5/site-packages/zmq/eventloop/zmqstream.py",   第472行,在_handle_recv中       self._run_callback(callback,msg)File" /home/ryan/.local/lib/python3.5/site-packages/zmq/eventloop/zmqstream.py",   第414行,在_run_callback中       回调(* args,** kwargs)文件" /home/ryan/.local/lib/python3.5/site-packages/tornado/stack_context.py",   第277行,在null_wrapper中       return fn(* args,** kwargs)File" /home/ryan/.local/lib/python3.5/site-packages/ipykernel/kernelbase.py",   第283行,在调度员中       return self.dispatch_shell(stream,msg)File" /home/ryan/.local/lib/python3.5/site-packages/ipykernel/kernelbase.py",   第235行,在dispatch_shell中       handler(stream,idents,msg)File" /home/ryan/.local/lib/python3.5/site-packages/ipykernel/kernelbase.py",   第399行,在execute_request中       user_expressions,allow_stdin)File" /home/ryan/.local/lib/python3.5/site-packages/ipykernel/ipkernel.py",   第196行,在do_execute中       res = shell.run_cell(code,store_history = store_history,silent = silent)文件   " /home/ryan/.local/lib/python3.5/site-packages/ipykernel/zmqshell.py" ;,   第533行,在run_cell中       return super(ZMQInteractiveShell,self).run_cell(* args,** kwargs)文件   " /home/ryan/.local/lib/python3.5/site-packages/IPython/core/interactiveshell.py" ;,   第2728行,在run_cell中       interactivity = interactive,compiler = compiler,result = result)文件   " /home/ryan/.local/lib/python3.5/site-packages/IPython/core/interactiveshell.py" ;,   第2850行,在run_ast_nodes中       if self.run_code(code,result):File" /home/ryan/.local/lib/python3.5/site-packages/IPython/core/interactiveshell.py",   第2910行,在run_code中       exec(code_obj,self.user_global_ns,self.user_ns)文件"",第7行,in       tf.import_graph_def(od_graph_def,name ='')File" /usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/importer.py",   第313行,在import_graph_def中       op_def = op_def)File" /usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/ops.py",   第2956行,在create_op中       op_def = op_def)File" /usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/ops.py",   第1470行,在 init 中       self._traceback = self._graph._extract_stack()#pylint:disable = protected-access

     

InvalidArgumentError(参见上面的回溯):NodeDef提及attr   ' T'不在Op索引中:int64&gt ;;   NodeDef:   后处理/ BatchMultiClassNonMaxSuppression /地图/时/ MultiClassNonMaxSuppression / FilterGreaterThan /在哪里   = WhereT = DT_BOOL,_device =" / job:localhost / replica:0 / task:0 / device:GPU:0"。   (检查您的GraphDef解释二进制文件是否是最新的   你的GraphDef生成二进制文件。)。 [[节点:   后处理/ BatchMultiClassNonMaxSuppression /地图/时/ MultiClassNonMaxSuppression / FilterGreaterThan /在哪里   = WhereT = DT_BOOL,_device =" / job:localhost / replica:0 / task:0 / device:GPU:0"]]

1 个答案:

答案 0 :(得分:0)

云和本地计算机是否运行相同的Python / Tensorflow版本?由于内部变量重命名,有时由特定Tensorflow版本生成的检查点不向后兼容。