老师,我之前在jupyter上是可以正常运行的,后面就报警告和错误了,您看看下面的图
来源:2-8 神经网络实现(多分类逻辑斯蒂回归模型实现)
慕丝1680230
2019-12-19
写回答
4回答
-
慕丝1680230
提问者
2019-12-25
报错如下: InternalError Traceback (most recent call last)D:\Anaconda\lib\site-packages\tensorflow\python\client\session.py in _do_call(self, fn, *args) 1333 try:-> 1334 return fn(*args) 1335 except errors.OpError as e:D:\Anaconda\lib\site-packages\tensorflow\python\client\session.py in _run_fn(feed_dict, fetch_list, target_list, options, run_metadata) 1318 return self._call_tf_sessionrun(-> 1319 options, feed_dict, fetch_list, target_list, run_metadata) 1320 D:\Anaconda\lib\site-packages\tensorflow\python\client\session.py in _call_tf_sessionrun(self, options, feed_dict, fetch_list, target_list, run_metadata) 1406 self._session, options, feed_dict, fetch_list, target_list,-> 1407 run_metadata) 1408 InternalError: Blas GEMM launch failed : a.shape=(20, 3072), b.shape=(3072, 100), m=20, n=100, k=3072 [[{{node dense/MatMul}}]] [[{{node Mean}}]] During handling of the above exception, another exception occurred:InternalError Traceback (most recent call last)<ipython-input-4-4745b1bfbcf2> in <module> 13 feed_dict={ 14 x: batch_data,---> 15 y: batch_labels}) 16 if (i+1) % 500 == 0: 17 print('[Train] Step: %d, loss: %4.5f, acc: %4.5f' D:\Anaconda\lib\site-packages\tensorflow\python\client\session.py in run(self, fetches, feed_dict, options, run_metadata) 927 try: 928 result = self._run(None, fetches, feed_dict, options_ptr,--> 929 run_metadata_ptr) 930 if run_metadata: 931 proto_data = tf_session.TF_GetBuffer(run_metadata_ptr)D:\Anaconda\lib\site-packages\tensorflow\python\client\session.py in _run(self, handle, fetches, feed_dict, options, run_metadata) 1150 if final_fetches or final_targets or (handle and feed_dict_tensor): 1151 results = self._do_run(handle, final_targets, final_fetches,-> 1152 feed_dict_tensor, options, run_metadata) 1153 else: 1154 results = []D:\Anaconda\lib\site-packages\tensorflow\python\client\session.py in _do_run(self, handle, target_list, fetch_list, feed_dict, options, run_metadata) 1326 if handle is None: 1327 return self._do_call(_run_fn, feeds, fetches, targets, options,-> 1328 run_metadata) 1329 else: 1330 return self._do_call(_prun_fn, handle, feeds, fetches)D:\Anaconda\lib\site-packages\tensorflow\python\client\session.py in _do_call(self, fn, *args) 1346 pass 1347 message = error_interpolation.interpolate(message, self._graph)-> 1348 raise type(e)(node_def, op, message) 1349 1350 def _extend_graph(self):InternalError: Blas GEMM launch failed : a.shape=(20, 3072), b.shape=(3072, 100), m=20, n=100, k=3072 [[node dense/MatMul (defined at <ipython-input-3-9b81457da280>:4) ]] [[node Mean (defined at <ipython-input-3-9b81457da280>:18) ]] Caused by op 'dense/MatMul', defined at: File "D:\Anaconda\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "D:\Anaconda\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "D:\Anaconda\lib\site-packages\ipykernel_launcher.py", line 16, in <module> app.launch_new_instance() File "D:\Anaconda\lib\site-packages\traitlets\config\application.py", line 658, in launch_instance app.start() File "D:\Anaconda\lib\site-packages\ipykernel\kernelapp.py", line 505, in start self.io_loop.start() File "D:\Anaconda\lib\site-packages\tornado\platform\asyncio.py", line 148, in start self.asyncio_loop.run_forever() File "D:\Anaconda\lib\asyncio\base_events.py", line 539, in run_forever self._run_once() File "D:\Anaconda\lib\asyncio\base_events.py", line 1775, in _run_once handle._run() File "D:\Anaconda\lib\asyncio\events.py", line 88, in _run self._context.run(self._callback, *self._args) File "D:\Anaconda\lib\site-packages\tornado\ioloop.py", line 690, in <lambda> lambda f: self._run_callback(functools.partial(callback, future)) File "D:\Anaconda\lib\site-packages\tornado\ioloop.py", line 743, in _run_callback ret = callback() File "D:\Anaconda\lib\site-packages\tornado\gen.py", line 781, in inner self.run() File "D:\Anaconda\lib\site-packages\tornado\gen.py", line 742, in run yielded = self.gen.send(value) File "D:\Anaconda\lib\site-packages\ipykernel\kernelbase.py", line 357, in process_one yield gen.maybe_future(dispatch(*args)) File "D:\Anaconda\lib\site-packages\tornado\gen.py", line 209, in wrapper yielded = next(result) File "D:\Anaconda\lib\site-packages\ipykernel\kernelbase.py", line 267, in dispatch_shell yield gen.maybe_future(handler(stream, idents, msg)) File "D:\Anaconda\lib\site-packages\tornado\gen.py", line 209, in wrapper yielded = next(result) File "D:\Anaconda\lib\site-packages\ipykernel\kernelbase.py", line 534, in execute_request user_expressions, allow_stdin, File "D:\Anaconda\lib\site-packages\tornado\gen.py", line 209, in wrapper yielded = next(result) File "D:\Anaconda\lib\site-packages\ipykernel\ipkernel.py", line 294, in do_execute res = shell.run_cell(code, store_history=store_history, silent=silent) File "D:\Anaconda\lib\site-packages\ipykernel\zmqshell.py", line 536, in run_cell return super(ZMQInteractiveShell, self).run_cell(*args, **kwargs) File "D:\Anaconda\lib\site-packages\IPython\core\interactiveshell.py", line 2848, in run_cell raw_cell, store_history, silent, shell_futures) File "D:\Anaconda\lib\site-packages\IPython\core\interactiveshell.py", line 2874, in _run_cell return runner(coro) File "D:\Anaconda\lib\site-packages\IPython\core\async_helpers.py", line 67, in _pseudo_sync_runner coro.send(None) File "D:\Anaconda\lib\site-packages\IPython\core\interactiveshell.py", line 3049, in run_cell_async interactivity=interactivity, compiler=compiler, result=result) File "D:\Anaconda\lib\site-packages\IPython\core\interactiveshell.py", line 3214, in run_ast_nodes if (yield from self.run_code(code, result)): File "D:\Anaconda\lib\site-packages\IPython\core\interactiveshell.py", line 3296, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "<ipython-input-3-9b81457da280>", line 4, in <module> hidden1 = tf.layers.dense(x, 100, activation=tf.nn.relu) File "D:\Anaconda\lib\site-packages\tensorflow\python\util\deprecation.py", line 324, in new_func return func(*args, **kwargs) File "D:\Anaconda\lib\site-packages\tensorflow\python\layers\core.py", line 188, in dense return layer.apply(inputs) File "D:\Anaconda\lib\site-packages\tensorflow\python\keras\engine\base_layer.py", line 1227, in apply return self.__call__(inputs, *args, **kwargs) File "D:\Anaconda\lib\site-packages\tensorflow\python\layers\base.py", line 530, in __call__ outputs = super(Layer, self).__call__(inputs, *args, **kwargs) File "D:\Anaconda\lib\site-packages\tensorflow\python\keras\engine\base_layer.py", line 554, in __call__ outputs = self.call(inputs, *args, **kwargs) File "D:\Anaconda\lib\site-packages\tensorflow\python\keras\layers\core.py", line 975, in call outputs = gen_math_ops.mat_mul(inputs, self.kernel) File "D:\Anaconda\lib\site-packages\tensorflow\python\ops\gen_math_ops.py", line 5333, in mat_mul name=name) File "D:\Anaconda\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 788, in _apply_op_helper op_def=op_def) File "D:\Anaconda\lib\site-packages\tensorflow\python\util\deprecation.py", line 507, in new_func return func(*args, **kwargs) File "D:\Anaconda\lib\site-packages\tensorflow\python\framework\ops.py", line 3300, in create_op op_def=op_def) File "D:\Anaconda\lib\site-packages\tensorflow\python\framework\ops.py", line 1801, in __init__ self._traceback = tf_stack.extract_stack() InternalError (see above for traceback): Blas GEMM launch failed : a.shape=(20, 3072), b.shape=(3072, 100), m=20, n=100, k=3072 [[node dense/MatMul (defined at <ipython-input-3-9b81457da280>:4) ]] [[node Mean (defined at <ipython-input-3-9b81457da280>:18) ]]
00 -
正十七
2019-12-22
从错误信息上看,是参数出错了,看起来像是sess.run的时候出错的,但从截图中看不出来更多的信息了。同学,你跟git上的代码对比下,如果还出错贴下代码。
012019-12-25 -
慕丝1680230
提问者
2019-12-19
在pycharm上运行一个代码 怎么精度相差那么多 贼低
012019-12-22 -
慕丝1680230
提问者
2019-12-19
还有这个警告
022021-06-19
相似问题