无法连接到X服务器 GOOGLE COLAB

我正在尝试使用Tensorflow对象检测APIGoogle COLAB上进行预测。我已经成功完成了训练过程和导出推理图任务。

但问题是当我试图进行新的预测时,它会抛出一些错误日志。

无法连接到X服务器

现在我无法进行新的预测。我的错误日志的一部分如下:

totalMemory: 11.17GiB freeMemory: 6.65GiB2019-02-07 15:08:38.398219: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1512] Adding visible gpu devices: 02019-02-07 15:08:38.745889: I tensorflow/core/common_runtime/gpu/gpu_device.cc:984] Device interconnect StreamExecutor with strength 1 edge matrix:2019-02-07 15:08:38.745955: I tensorflow/core/common_runtime/gpu/gpu_device.cc:990]      0 2019-02-07 15:08:38.745975: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1003] 0:   N2019-02-07 15:08:38.746201: W tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:42] Overriding allow_growth setting because the TF_FORCE_GPU_ALLOW_GROWTH environment variable is set. Original config value was 0.2019-02-07 15:08:38.746259: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1115] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 6426 MB memory) -> physical GPU (device: 0, name: Tesla K80, pci bus id: 0000:00:04.0, compute capability: 3.7)2019-02-07 15:08:39.683618: W ./tensorflow/core/grappler/optimizers/graph_optimizer_stage.h:241] Failed to run optimizer ArithmeticOptimizer, stage RemoveStackStridedSliceSameAxis node Preprocessor/map/while/ResizeToRange/strided_slice_3. Error: Pack node (Preprocessor/map/while/ResizeToRange/stack_2) axis attribute is out of bounds: 02019-02-07 15:08:40.360560: W ./tensorflow/core/grappler/optimizers/graph_optimizer_stage.h:241] Failed to run optimizer ArithmeticOptimizer, stage RemoveStackStridedSliceSameAxis node Preprocessor/map/while/ResizeToRange/strided_slice_3. Error: Pack node (Preprocessor/map/while/ResizeToRange/stack_2) axis attribute is out of bounds: 02019-02-07 15:08:40.646093: I tensorflow/stream_executor/dso_loader.cc:152] successfully opened CUDA library libcublas.so.10.0 locally: cannot connect to X server 

我如何找出这个问题的原因?


回答:

X服务器是X窗口系统中的一个程序,运行在本地机器上(即用户直接使用的计算机),并处理对这些计算机上的显卡、显示屏和输入设备(通常是键盘和鼠标)的所有访问。

既然如此,Colab作为服务器上的终端实例运行,如果您使用的是GPU运行时,那么问题不在于X服务器访问您的显卡,也不在于输入设备,通常这种情况发生在您尝试解析一些应该在桌面显示为单独窗口的数据时,像cv2.imshow()这样的命令,其他类似的函数也可能导致这个问题,如果您必须使用图形输出,您可能需要考虑使用%matplotlib notebook并在可交互的matplotlib图表中显示数据。

如果这不是您的问题,请发布您修改后的代码链接,我可能会提供更多帮助。

Related Posts

在使用k近邻算法时,有没有办法获取被使用的“邻居”?

我想找到一种方法来确定在我的knn算法中实际使用了哪些…

Theano在Google Colab上无法启用GPU支持

我在尝试使用Theano库训练一个模型。由于我的电脑内…

准确性评分似乎有误

这里是代码: from sklearn.metrics…

Keras Functional API: “错误检查输入时:期望input_1具有4个维度,但得到形状为(X, Y)的数组”

我在尝试使用Keras的fit_generator来训…

如何使用sklearn.datasets.make_classification在指定范围内生成合成数据?

我想为分类问题创建合成数据。我使用了sklearn.d…

如何处理预测时不在训练集中的标签

已关闭。 此问题与编程或软件开发无关。目前不接受回答。…

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注