A
A
Albert2018-10-30 13:50:31
Python
Albert, 2018-10-30 13:50:31

Git + Google Colab = No module what is missing when cloning a repository?

I use Google colab
I will show on a specific example.
I open a new empty project, python3
I clone the repository as follows

!git clone https://github.com/tomlepaine/fast-wavenet.git
%cd fast-wavenet

Then I run the cell cell with the following content:
(the code should be working, as it is taken from the ipynb demo of the same repository https://github.com/tomlepaine/fast-wavenet/blob/ma... - the very beginning)
from time import time

from wavenet.utils import make_batch
from wavenet.models import Model, Generator

from IPython.display import Audio

%matplotlib inline

And I get this error:
--------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-6-4dd95abb40c7> in <module>()
      2 
      3 from wavenet.utils import make_batch
----> 4 from wavenet.models import Model, Generator
      5 
      6 from IPython.display import Audio

/content/fast-wavenet/wavenet/models.py in <module>()
      2 import numpy as np
      3 import tensorflow as tf
----> 4 from layers import (_causal_linear, _output_linear, conv1d,
      5                     dilated_conv1d)
      6 

ModuleNotFoundError: No module named 'layers'

---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the
"Open Examples" button below.
---------------------------------------------------------------------------

Looked in issues. Nobody writes about this problem, apparently I missed something elementary.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Albert, 2018-10-31
@bigburn

The repository has a layers.
everything works like this:

!git clone https://github.com/tomlepaine/fast-wavenet.git
%cd fast-wavenet/wavenet

Not just %cd fast-wavenet
Second cell:
from time import time
from utils import make_batch
from models import Model, Generator
from IPython.display import Audio
%matplotlib inline

Here and below, we simply delete wherever there is 'wavenet.'

S
sim3x, 2018-10-30
@sim3x

NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.
!pip layers

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question