Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/294.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python NotFoundError:从检查点还原失败。这很可能是由于检查点中缺少变量名或其他图形键_Python_Tensorflow - Fatal编程技术网

Python NotFoundError:从检查点还原失败。这很可能是由于检查点中缺少变量名或其他图形键

Python NotFoundError:从检查点还原失败。这很可能是由于检查点中缺少变量名或其他图形键,python,tensorflow,Python,Tensorflow,我刚刚开始在python中使用tensorflow。我正在尝试使图像分类工具正常工作(参考:)“将微调模型应用于某些图像。”部分 使用预先训练的模型 当神经网络有许多参数时,它们工作得最好,这使它们成为非常灵活的函数逼近器。然而,这意味着他们必须接受大数据集的培训。由于这个过程很慢,我们提供了各种经过预培训的模型-请参见此处的列表 您可以按原样使用这些模型,也可以对它们执行“手术”,以修改它们以执行其他任务。例如,常见的做法是“切掉”最后一个pre-softmax层,并将其替换为对应于某一组新标

我刚刚开始在python中使用tensorflow。我正在尝试使图像分类工具正常工作(参考:)“将微调模型应用于某些图像。”部分

使用预先训练的模型

当神经网络有许多参数时,它们工作得最好,这使它们成为非常灵活的函数逼近器。然而,这意味着他们必须接受大数据集的培训。由于这个过程很慢,我们提供了各种经过预培训的模型-请参见此处的列表

您可以按原样使用这些模型,也可以对它们执行“手术”,以修改它们以执行其他任务。例如,常见的做法是“切掉”最后一个pre-softmax层,并将其替换为对应于某一组新标签的一组新权重。然后,可以在一个小的新数据集上快速微调新模型。我们在下面用inception-v1作为基本模型来说明这一点。虽然像Inception V3这样的模型更强大,但Inception V1用于提高速度

考虑到VGG和ResNet最终层只有1000个输出,而不是1001个。提供的ImageNet数据集有一个空的后台类,可用于根据其他任务微调模型。这里提供的VGG和ResNet模型不使用该类。我们提供了两个使用预训练模型的示例:Inception V1和VGG-19模型来突出这一差异

下面是我已经实现的代码

from matplotlib import pyplot as plt
import numpy as np
import os
import tensorflow as tf

from nets import inception
from datasets import images_original
from preprocessing import inception_preprocessing

checkpoints_dir = '/tmp/train_inception_v1_images_original_FineTune_logs/all'

slim = tf.contrib.slim
batch_size = 10
images_dir = '/content/drive/MyDrive/ColabNotebooks/종합설계/tmp/images_original/images_original_photos'
image_size = inception.inception_v1.default_image_size    

def load_batch(dataset, batch_size=16, height=244, width=244, is_training=False):
    """Loads a single batch of data.
    
    Args:
      dataset: The dataset to load.
      batch_size: The number of images in the batch.
      height: The size of each image after preprocessing.
      width: The size of each image after preprocessing.
      is_training: Whether or not we're currently training or evaluating.
    
    Returns:
      images: A Tensor of size [batch_size, height, width, 3], image samples that have been preprocessed.
      images_raw: A Tensor of size [batch_size, height, width, 3], image samples that can be used for visualization.
      labels: A Tensor of size [batch_size], whose values range between 0 and dataset.num_classes.
    """
    data_provider = slim.dataset_data_provider.DatasetDataProvider( 
        dataset, common_queue_capacity=32,
        common_queue_min=8)
    image_raw, label = data_provider.get(['image', 'label'])
    
    # Preprocess image for usage by Inception.
    image = inception_preprocessing.preprocess_image(image_raw, height, width, is_training=is_training)
    
    # Preprocess the image for display purposes.
    image_raw = tf.expand_dims(image_raw, 0)
    image_raw = tf.image.resize_images(image_raw, [height, width])
    image_raw = tf.squeeze(image_raw)

    # Batch it up.
    images, images_raw, labels = tf.train.batch(
          [image, image_raw, label],
          batch_size=batch_size,
          num_threads=1,
          capacity=2 * batch_size)
    
    return images, images_raw, labels

with tf.Graph().as_default():
    tf.logging.set_verbosity(tf.logging.INFO)
    
    dataset = images_original.get_split('validation', images_dir)
    images, images_raw, labels = load_batch(dataset, height=image_size, width=image_size)
    
    # Create the model, use the default arg scope to configure the batch norm parameters.
    with slim.arg_scope(inception.inception_v1_arg_scope()):
        logits, _ = inception.inception_v1(images, num_classes=dataset.num_classes, is_training=True)

    probabilities = tf.nn.softmax(logits)
    
    checkpoint_path = tf.train.latest_checkpoint(checkpoints_dir)
    init_fn = slim.assign_from_checkpoint_fn(
      checkpoint_path,
      slim.get_variables_to_restore())
    
    with tf.Session() as sess:
        with slim.queues.QueueRunners(sess):
            sess.run(tf.initialize_local_variables())
            tf_saver = tf.train.import_meta_graph('/content/drive/MyDrive/ColabNotebooks/종합설계/tmp/train_inception_v1_images_original_FineTune_logs/all/model.ckpt-500.meta')
            tf_saver.restore(sess, '/content/drive/MyDrive/ColabNotebooks/종합설계/tmp/train_inception_v1_images_original_FineTune_logs/all/model.ckpt-500')
            tf_saver = tf.train.Saver(save_relative_paths=True)
            init_fn(sess)
            np_probabilities, np_images_raw, np_labels = sess.run([probabilities, images_raw, labels])
    
            for i in range(batch_size): 
                image = np_images_raw[i, :, :, :]
                true_label = np_labels[i]
                predicted_label = np.argmax(np_probabilities[i, :])
                predicted_name = dataset.labels_to_names[predicted_label]
                true_name = dataset.labels_to_names[true_label]
                
                plt.figure()
                plt.imshow(image.astype(np.uint8))
                plt.title('Ground Truth: [%s], Prediction [%s]' % (true_name, predicted_name))
                plt.axis('off')
                plt.show()
我有以下错误

INFO:tensorflow:Restoring parameters from /content/drive/MyDrive/ColabNotebooks/종합설계/tmp/train_inception_v1_images_original_FineTune_logs/all/model.ckpt-500
---------------------------------------------------------------------------
NotFoundError                             Traceback (most recent call last)
/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/client/session.py in _do_call(self, fn, *args)
   1364     try:
-> 1365       return fn(*args)
   1366     except errors.OpError as e:

11 frames
NotFoundError: 2 root error(s) found.
  (0) Not found: Key InceptionV1/Conv2d_1a_7x7/biases not found in checkpoint
     [[{{node save_1/RestoreV2}}]]
  (1) Not found: Key InceptionV1/Conv2d_1a_7x7/biases not found in checkpoint
     [[{{node save_1/RestoreV2}}]]
     [[save_1/RestoreV2/_229]]
0 successful operations.
0 derived errors ignored.

During handling of the above exception, another exception occurred:

NotFoundError                             Traceback (most recent call last)
NotFoundError: 2 root error(s) found.
  (0) Not found: Key InceptionV1/Conv2d_1a_7x7/biases not found in checkpoint
     [[node save_1/RestoreV2 (defined at /usr/local/lib/python3.7/dist-packages/tensorflow_core/python/framework/ops.py:1748) ]]
  (1) Not found: Key InceptionV1/Conv2d_1a_7x7/biases not found in checkpoint
     [[node save_1/RestoreV2 (defined at /usr/local/lib/python3.7/dist-packages/tensorflow_core/python/framework/ops.py:1748) ]]
     [[save_1/RestoreV2/_229]]
0 successful operations.
0 derived errors ignored.

Original stack trace for 'save_1/RestoreV2':
  File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.7/dist-packages/ipykernel_launcher.py", line 16, in <module>
    app.launch_new_instance()
  File "/usr/local/lib/python3.7/dist-packages/traitlets/config/application.py", line 845, in launch_instance
    app.start()
  File "/usr/local/lib/python3.7/dist-packages/ipykernel/kernelapp.py", line 499, in start
    self.io_loop.start()
  File "/usr/local/lib/python3.7/dist-packages/tornado/platform/asyncio.py", line 132, in start
    self.asyncio_loop.run_forever()
  File "/usr/lib/python3.7/asyncio/base_events.py", line 541, in run_forever
    self._run_once()
  File "/usr/lib/python3.7/asyncio/base_events.py", line 1786, in _run_once
    handle._run()
  File "/usr/lib/python3.7/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/local/lib/python3.7/dist-packages/tornado/platform/asyncio.py", line 122, in _handle_events
    handler_func(fileobj, events)
  File "/usr/local/lib/python3.7/dist-packages/tornado/stack_context.py", line 300, in null_wrapper
    return fn(*args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/zmq/eventloop/zmqstream.py", line 451, in _handle_events
    self._handle_recv()
  File "/usr/local/lib/python3.7/dist-packages/zmq/eventloop/zmqstream.py", line 480, in _handle_recv
    self._run_callback(callback, msg)
  File "/usr/local/lib/python3.7/dist-packages/zmq/eventloop/zmqstream.py", line 434, in _run_callback
    callback(*args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/tornado/stack_context.py", line 300, in null_wrapper
    return fn(*args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/ipykernel/kernelbase.py", line 283, in dispatcher
    return self.dispatch_shell(stream, msg)
  File "/usr/local/lib/python3.7/dist-packages/ipykernel/kernelbase.py", line 233, in dispatch_shell
    handler(stream, idents, msg)
  File "/usr/local/lib/python3.7/dist-packages/ipykernel/kernelbase.py", line 399, in execute_request
    user_expressions, allow_stdin)
  File "/usr/local/lib/python3.7/dist-packages/ipykernel/ipkernel.py", line 208, in do_execute
    res = shell.run_cell(code, store_history=store_history, silent=silent)
  File "/usr/local/lib/python3.7/dist-packages/ipykernel/zmqshell.py", line 537, in run_cell
    return super(ZMQInteractiveShell, self).run_cell(*args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/IPython/core/interactiveshell.py", line 2718, in run_cell
    interactivity=interactivity, compiler=compiler, result=result)
  File "/usr/local/lib/python3.7/dist-packages/IPython/core/interactiveshell.py", line 2822, in run_ast_nodes
    if self.run_code(code, result):
  File "/usr/local/lib/python3.7/dist-packages/IPython/core/interactiveshell.py", line 2882, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-12-8051e6647c27>", line 75, in <module>
    tf_saver = tf.train.import_meta_graph('/content/drive/MyDrive/ColabNotebooks/종합설계/tmp/train_inception_v1_images_original_FineTune_logs/all/model.ckpt-500.meta')
  File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/training/saver.py", line 1453, in import_meta_graph
    **kwargs)[0]
  File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/training/saver.py", line 1480, in _import_meta_graph_with_return_elements
    imported_vars)
  File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/training/saver.py", line 1500, in _create_saver_from_imported_meta_graph
    return Saver()
  File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/training/saver.py", line 828, in __init__
    self.build()
  File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/training/saver.py", line 840, in build
    self._build(self._filename, build_save=True, build_restore=True)
  File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/training/saver.py", line 878, in _build
    build_restore=build_restore)
  File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/training/saver.py", line 508, in _build_internal
    restore_sequentially, reshape)
  File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/training/saver.py", line 328, in _AddRestoreOps
    restore_sequentially)
  File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/training/saver.py", line 575, in bulk_restore
    return io_ops.restore_v2(filename_tensor, names, slices, dtypes)
  File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/ops/gen_io_ops.py", line 1696, in restore_v2
    name=name)
  File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/framework/op_def_library.py", line 794, in _apply_op_helper
    op_def=op_def)
  File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/util/deprecation.py", line 507, in new_func
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/framework/ops.py", line 3357, in create_op
    attrs, op_def, compute_device)
  File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/framework/ops.py", line 3426, in _create_op_internal
    op_def=op_def)
  File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/framework/ops.py", line 1748, in __init__
    self._traceback = tf_stack.extract_stack()


During handling of the above exception, another exception occurred:

NotFoundError                             Traceback (most recent call last)
NotFoundError: Key _CHECKPOINTABLE_OBJECT_GRAPH not found in checkpoint

During handling of the above exception, another exception occurred:

NotFoundError                             Traceback (most recent call last)
/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/training/saver.py in restore(self, sess, save_path)
   1304         # a helpful message (b/110263146)
   1305         raise _wrap_restore_error_with_msg(
-> 1306             err, "a Variable name or other graph key that is missing")
   1307 
   1308       # This is an object-based checkpoint. We'll print a warning and then do

NotFoundError: Restoring from checkpoint failed. This is most likely due to a Variable name or other graph key that is missing from the checkpoint. Please ensure that you have not altered the graph expected based on the checkpoint. Original error:

2 root error(s) found.
  (0) Not found: Key InceptionV1/Conv2d_1a_7x7/biases not found in checkpoint
     [[node save_1/RestoreV2 (defined at /usr/local/lib/python3.7/dist-packages/tensorflow_core/python/framework/ops.py:1748) ]]
  (1) Not found: Key InceptionV1/Conv2d_1a_7x7/biases not found in checkpoint
     [[node save_1/RestoreV2 (defined at /usr/local/lib/python3.7/dist-packages/tensorflow_core/python/framework/ops.py:1748) ]]
     [[save_1/RestoreV2/_229]]
0 successful operations.
0 derived errors ignored.

Original stack trace for 'save_1/RestoreV2':
  File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.7/dist-packages/ipykernel_launcher.py", line 16, in <module>
    app.launch_new_instance()
  File "/usr/local/lib/python3.7/dist-packages/traitlets/config/application.py", line 845, in launch_instance
    app.start()
  File "/usr/local/lib/python3.7/dist-packages/ipykernel/kernelapp.py", line 499, in start
    self.io_loop.start()
  File "/usr/local/lib/python3.7/dist-packages/tornado/platform/asyncio.py", line 132, in start
    self.asyncio_loop.run_forever()
  File "/usr/lib/python3.7/asyncio/base_events.py", line 541, in run_forever
    self._run_once()
  File "/usr/lib/python3.7/asyncio/base_events.py", line 1786, in _run_once
    handle._run()
  File "/usr/lib/python3.7/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/local/lib/python3.7/dist-packages/tornado/platform/asyncio.py", line 122, in _handle_events
    handler_func(fileobj, events)
  File "/usr/local/lib/python3.7/dist-packages/tornado/stack_context.py", line 300, in null_wrapper
    return fn(*args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/zmq/eventloop/zmqstream.py", line 451, in _handle_events
    self._handle_recv()
  File "/usr/local/lib/python3.7/dist-packages/zmq/eventloop/zmqstream.py", line 480, in _handle_recv
    self._run_callback(callback, msg)
  File "/usr/local/lib/python3.7/dist-packages/zmq/eventloop/zmqstream.py", line 434, in _run_callback
    callback(*args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/tornado/stack_context.py", line 300, in null_wrapper
    return fn(*args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/ipykernel/kernelbase.py", line 283, in dispatcher
    return self.dispatch_shell(stream, msg)
  File "/usr/local/lib/python3.7/dist-packages/ipykernel/kernelbase.py", line 233, in dispatch_shell
    handler(stream, idents, msg)
  File "/usr/local/lib/python3.7/dist-packages/ipykernel/kernelbase.py", line 399, in execute_request
    user_expressions, allow_stdin)
  File "/usr/local/lib/python3.7/dist-packages/ipykernel/ipkernel.py", line 208, in do_execute
    res = shell.run_cell(code, store_history=store_history, silent=silent)
  File "/usr/local/lib/python3.7/dist-packages/ipykernel/zmqshell.py", line 537, in run_cell
    return super(ZMQInteractiveShell, self).run_cell(*args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/IPython/core/interactiveshell.py", line 2718, in run_cell
    interactivity=interactivity, compiler=compiler, result=result)
  File "/usr/local/lib/python3.7/dist-packages/IPython/core/interactiveshell.py", line 2822, in run_ast_nodes
    if self.run_code(code, result):
  File "/usr/local/lib/python3.7/dist-packages/IPython/core/interactiveshell.py", line 2882, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-12-8051e6647c27>", line 75, in <module>
    tf_saver = tf.train.import_meta_graph('/content/drive/MyDrive/ColabNotebooks/종합설계/tmp/train_inception_v1_images_original_FineTune_logs/all/model.ckpt-500.meta')
  File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/training/saver.py", line 1453, in import_meta_graph
    **kwargs)[0]
  File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/training/saver.py", line 1480, in _import_meta_graph_with_return_elements
    imported_vars)
  File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/training/saver.py", line 1500, in _create_saver_from_imported_meta_graph
    return Saver()
  File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/training/saver.py", line 828, in __init__
    self.build()
  File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/training/saver.py", line 840, in build
    self._build(self._filename, build_save=True, build_restore=True)
  File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/training/saver.py", line 878, in _build
    build_restore=build_restore)
  File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/training/saver.py", line 508, in _build_internal
    restore_sequentially, reshape)
  File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/training/saver.py", line 328, in _AddRestoreOps
    restore_sequentially)
  File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/training/saver.py", line 575, in bulk_restore
    return io_ops.restore_v2(filename_tensor, names, slices, dtypes)
  File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/ops/gen_io_ops.py", line 1696, in restore_v2
    name=name)
  File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/framework/op_def_library.py", line 794, in _apply_op_helper
    op_def=op_def)
  File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/util/deprecation.py", line 507, in new_func
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/framework/ops.py", line 3357, in create_op
    attrs, op_def, compute_device)
  File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/framework/ops.py", line 3426, in _create_op_internal
    op_def=op_def)
  File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/framework/ops.py", line 1748, in __init__
    self._traceback = tf_stack.extract_stack()
  
INFO:tensorflow:从/content/drive/MyDrive/ColabNotebooks还原参数/종합설계/tmp/train\u inception\u v1\u images\u original\u FineTune\u logs/all/model.ckpt-500
---------------------------------------------------------------------------
NotFoundError回溯(最近一次调用上次)
/调用中的usr/local/lib/python3.7/dist-packages/tensorflow\u core/python/client/session.py(self,fn,*args)
1364尝试:
->1365返回fn(*args)
1366错误除外。操作错误为e:
11帧
NotFoundError:找到2个根错误。
(0)未找到:在检查点中未找到钥匙接收v1/Conv2d_1a_7x7/偏差
[{{node save_1/RestoreV2}]]
(1) 未找到:在检查点中未找到密钥接收v1/Conv2d_1a_7x7/偏差
[{{node save_1/RestoreV2}]]
[[save_1/RestoreV2/_229]]
0成功的操作。
忽略0个派生错误。
在处理上述异常期间,发生了另一个异常:
NotFoundError回溯(最近一次调用上次)
NotFoundError:找到2个根错误。
(0)未找到:在检查点中未找到钥匙接收v1/Conv2d_1a_7x7/偏差
[[node save_1/RestoreV2(定义于/usr/local/lib/python3.7/dist packages/tensorflow_core/python/framework/ops.py:1748)]]
(1) 未找到:在检查点中未找到密钥接收v1/Conv2d_1a_7x7/偏差
[[node save_1/RestoreV2(定义于/usr/local/lib/python3.7/dist packages/tensorflow_core/python/framework/ops.py:1748)]]
[[save_1/RestoreV2/_229]]
0成功的操作。
忽略0个派生错误。
“save_1/RestoreV2”的原始堆栈跟踪:
文件“/usr/lib/python3.7/runpy.py”,第193行,在“运行”模块中作为“主”
“\uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu
文件“/usr/lib/python3.7/runpy.py”,第85行,在运行代码中
exec(代码、运行\全局)
文件“/usr/local/lib/python3.7/dist packages/ipykernel_launcher.py”,第16行,在
app.launch_new_instance()
文件“/usr/local/lib/python3.7/dist-packages/traitlets/config/application.py”,第845行,在launch_实例中
app.start()
文件“/usr/local/lib/python3.7/dist-packages/ipykernel/kernelapp.py”,第499行,开始
self.io_loop.start()
文件“/usr/local/lib/python3.7/dist-packages/tornado/platform/asyncio.py”,第132行,开头
self.asyncio\u loop.run\u forever()
文件“/usr/lib/python3.7/asyncio/base\u events.py”,第541行,永远运行
self._run_once()
文件“/usr/lib/python3.7/asyncio/base\u events.py”,第1786行,运行一次
句柄。_run()
文件“/usr/lib/python3.7/asyncio/events.py”,第88行,在运行中
self.\u context.run(self.\u回调,*self.\u参数)
文件“/usr/local/lib/python3.7/dist packages/tornado/platform/asyncio.py”,第122行,在事件处理中
handler_func(fileobj,事件)
文件“/usr/local/lib/python3.7/dist packages/tornado/stack\u context.py”,第300行,在空包装中
返回fn(*args,**kwargs)
文件“/usr/local/lib/python3.7/dist packages/zmq/eventloop/zmqstream.py”,第451行,在事件句柄中
self.\u handle\u recv()
文件“/usr/local/lib/python3.7/dist packages/zmq/eventloop/zmqstream.py”,第480行,在
self.\u运行\u回调(回调,消息)
文件“/usr/local/lib/python3.7/dist packages/zmq/eventloop/zmqstream.py”,第434行,在运行回调中
回调(*args,**kwargs)
文件“/usr/local/lib/python3.7/dist packages/tornado/stack\u context.py”,第300行,在空包装中
返回fn(*args,**kwargs)
dispatcher中的文件“/usr/local/lib/python3.7/dist packages/ipykernel/kernelbase.py”,第283行
返回self.dispatch\u shell(流,消息)
文件“/usr/local/lib/python3.7/dist packages/ipykernel/kernelbase.py”,第233行,在dispatch_shell中
处理程序(流、标识、消息)
文件“/usr/local/lib/python3.7/dist packages/ipykernel/kernelbase.py”,第399行,在执行请求中
用户\u表达式,允许\u stdin)
文件“/usr/local/lib/python3.7/dist packages/ipykernel/ipkernel.py”,第208行,在do_execute中
res=shell.run\u单元格(代码,store\u history=store\u history,silent=silent)
文件“/usr/local/lib/python3.7/dist packages/ipykernel/zmqshell.py”,第537行,在run_单元格中
返回超级(ZMQInteractiveShell,self)。运行单元格(*args,**kwargs)
文件“/usr/local/lib/python3.7/dist-packages/IPython/core/interactiveshell.py”,第2718行,在运行单元中
交互性=交互性,编译器=编译器,结果=结果)
文件“/usr/local/lib/python3.7/dist-packages/IPython/core/interacti