Colab fails to find a module when initializing the model
See original GitHub issueWhen running the code under the title “Initialize the model”, got this error:
Downloading model bundle. This will take less than a minute...
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-8-877ee4174f89> in <module>()
4 # Import dependencies.
5 from magenta.models.melody_rnn import melody_rnn_sequence_generator
----> 6 from magenta.models.shared import sequence_generator_bundle
7 from magenta.music.protobuf import generator_pb2
8 from magenta.music.protobuf import music_pb2
/usr/local/lib/python3.6/dist-packages/magenta/models/shared/sequence_generator_bundle.py in <module>()
15 """Utility functions for handling bundle files."""
16
---> 17 from magenta.protobuf import generator_pb2
18 import tensorflow as tf
19 from google.protobuf import message
ModuleNotFoundError: No module named 'magenta.protobuf'
---------------------------------------------------------------------------
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.
---------------------------------------------------------------------------
maybe a library version mismatch?
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
import import tensorflow_docs error on Colab - Stack Overflow
This error is caused by the dict[str, str] line. This is PEP-585 compliant code that works in Python 3.9, but it looks like...
Read more >Saving and loading models for inference in PyTorch
Steps · 1. Import necessary libraries for loading our data · 2. Define and intialize the neural network · 3. Initialize the optimizer...
Read more >Python import: Advanced Techniques and Tips
You'll learn from several code examples throughout. In this tutorial, you'll learn how to: Use modules, packages, and namespace packages; Handle resources and ......
Read more >Google Colab - neptune.ai documentation
By running your model training in a Colab notebook and keeping track of it ... How do I find my API token? ......
Read more >PySpark on Google Colab 101 - Towards Data Science
Since it runs on the Google server, we don't need to install anything in our system locally, be it Spark or any deep...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the report, @opheliagame! The problem ended up being the
%tensorflow_version 1.x
line, which apparently resets the packages installed and reverts the magenta package to a very old version. If you just move that to the top of the cell, it should start working.We’ll have a fixed version posted in a couple days.
I am having the same issue in the Making Sounds with Note Sequences section. This error appears in the first step, while installing dependencies.
Next step gives
I have tried factory resetting the runtime, but that doesn’t help.