简体   繁体   English

如何在 Google Colab 中导入 python 文件

[英]How to import python files in Google Colab

So I have been trying to make this file compatible to Google Colab but I'm not able to find any way to do it.所以我一直在尝试使这个文件与 Google Colab 兼容,但我找不到任何方法来做到这一点。

[ [档案整理 ] ]

EfficientDet-DeepSORT-Tracker is the main folder of this entire package EfficientDet-DeepSORT-Tracker 是整个包的主文件夹

在此处输入图像描述

This picture is from one of the files placed alongside backbone.py这张图片来自放置在backbone.py旁边的文件之一

How to fix the fact that the file isn't able to detect backbone.py?如何解决文件无法检测到backbone.py的事实?

EDIT for more context: I shared the errors I found when trying to run waymo_open_dataset.py which isn't able to detect the other .py files alongside it.编辑更多上下文:我分享了我在尝试运行 waymo_open_dataset.py 时发现的错误,该错误无法检测到旁边的其他 .py 文件。

在此处输入图像描述

According to this past question you could import 'filename' of the filename.py.根据这个过去的问题,您可以导入 filename.py 的“文件名”。 So in the main.py file you are trying to run in colab, then import the required files in the main.py file.因此,在您尝试在 colab 中运行的 main.py 文件中,然后在 main.py 文件中导入所需的文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM