I am trying to run a pytorch code in google colab. The github repository is:
There is a custom module in google colab notebook. To build the module I have run python setup.py build_ext --inplace
My folder structure:
ls /content/drive/MyDrive/FaceDetector
doc mtcnn output README.md scripts setup.py tests tutorial
I have also added in sys path
import sys
sys.path.append('/content/drive/MyDrive/FaceDetector')
So when I try to import it
import mtcnn
I am getting an error:
ModuleNotFoundError
Traceback (most recent call last)
[<ipython-input-61-eb80d650f81e>](https://localhost:8080/#) in <module>
----> 1 import mtcnn
---
2 frames
---
[/content/drive/MyDrive/FaceDetector/mtcnn/deploy/detect.py](https://localhost:8080/#) in <module>
4 import time
5 ----> 6 import mtcnn.utils.functional as func
7 8 def _no_grad(func):
ModuleNotFoundError: No module named 'mtcnn.utils.functional'
Google Colab Notebook Link: https://colab.research.google.com/drive/1KQRF-HmZA7EU13acnwIX0dFayRMIuQ-B?usp=sharing
I needed to set my PYTHONPATH environment variable.
!PYTHONPATH=/content/drive/My\ Drive/FaceDetector python scripts/gen_pnet_train.py