Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Fresh install doesn't work #294

Closed
sdatkinson opened this issue Jul 27, 2023 · 4 comments · Fixed by #295 or #296
Closed

[BUG] Fresh install doesn't work #294

sdatkinson opened this issue Jul 27, 2023 · 4 comments · Fixed by #295 or #296
Labels
bug Something isn't working priority:high Prioritize

Comments

@sdatkinson
Copy link
Owner

Describe the bug
Following the install instructions from scratch no longer works.

To Reproduce
Steps to reproduce the behavior:

  • On a Macbook Pro with Intel processor
  • Downloaded latest Anaconda installer for Mac (Intel) from https://www.anaconda.com/ (accessed July 26 2023). Download is called Anaconda3-2023.07-1-MacOSX-x86_64.pkg
  • Ran installer, all default settings.
  • Opened terminal and ran pip install --upgrade neural-amp-modeler.
  • Type nam and press enter

Terminal output is:

(base) steve@Stevens-MacBook-Pro ~ % pip install --upgrade neural-amp-modeler
Collecting neural-amp-modeler
  Downloading neural_amp_modeler-0.7.0-py3-none-any.whl (218 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 218.3/218.3 kB 4.3 MB/s eta 0:00:00
Collecting auraloss==0.3.0 (from neural-amp-modeler)
  Using cached auraloss-0.3.0-py3-none-any.whl (15 kB)
Requirement already satisfied: matplotlib in ./anaconda3/lib/python3.11/site-packages (from neural-amp-modeler) (3.7.1)
Requirement already satisfied: numpy in ./anaconda3/lib/python3.11/site-packages (from neural-amp-modeler) (1.24.3)
Collecting pydantic (from neural-amp-modeler)
  Downloading pydantic-2.1.1-py3-none-any.whl (370 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 370.9/370.9 kB 6.2 MB/s eta 0:00:00
Collecting pytorch-lightning (from neural-amp-modeler)
  Downloading pytorch_lightning-2.0.6-py3-none-any.whl (722 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 722.8/722.8 kB 10.9 MB/s eta 0:00:00
Requirement already satisfied: scipy in ./anaconda3/lib/python3.11/site-packages (from neural-amp-modeler) (1.10.1)
Collecting sounddevice (from neural-amp-modeler)
  Using cached sounddevice-0.4.6-py3-none-macosx_10_6_x86_64.macosx_10_6_universal2.whl (107 kB)
Collecting tensorboard (from neural-amp-modeler)
  Using cached tensorboard-2.13.0-py3-none-any.whl (5.6 MB)
Collecting torch (from neural-amp-modeler)
  Downloading torch-2.0.1-cp311-none-macosx_10_9_x86_64.whl (143.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 143.1/143.1 MB 11.3 MB/s eta 0:00:00
Requirement already satisfied: tqdm in ./anaconda3/lib/python3.11/site-packages (from neural-amp-modeler) (4.65.0)
Collecting wavio>=0.0.5 (from neural-amp-modeler)
  Using cached wavio-0.0.7-py2.py3-none-any.whl (8.7 kB)
Requirement already satisfied: contourpy>=1.0.1 in ./anaconda3/lib/python3.11/site-packages (from matplotlib->neural-amp-modeler) (1.0.5)
Requirement already satisfied: cycler>=0.10 in ./anaconda3/lib/python3.11/site-packages (from matplotlib->neural-amp-modeler) (0.11.0)
Requirement already satisfied: fonttools>=4.22.0 in ./anaconda3/lib/python3.11/site-packages (from matplotlib->neural-amp-modeler) (4.25.0)
Requirement already satisfied: kiwisolver>=1.0.1 in ./anaconda3/lib/python3.11/site-packages (from matplotlib->neural-amp-modeler) (1.4.4)
Requirement already satisfied: packaging>=20.0 in ./anaconda3/lib/python3.11/site-packages (from matplotlib->neural-amp-modeler) (23.0)
Requirement already satisfied: pillow>=6.2.0 in ./anaconda3/lib/python3.11/site-packages (from matplotlib->neural-amp-modeler) (9.4.0)
Requirement already satisfied: pyparsing>=2.3.1 in ./anaconda3/lib/python3.11/site-packages (from matplotlib->neural-amp-modeler) (3.0.9)
Requirement already satisfied: python-dateutil>=2.7 in ./anaconda3/lib/python3.11/site-packages (from matplotlib->neural-amp-modeler) (2.8.2)
Collecting annotated-types>=0.4.0 (from pydantic->neural-amp-modeler)
  Downloading annotated_types-0.5.0-py3-none-any.whl (11 kB)
Collecting pydantic-core==2.4.0 (from pydantic->neural-amp-modeler)
  Downloading pydantic_core-2.4.0-cp311-cp311-macosx_10_7_x86_64.whl (1.7 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.7/1.7 MB 21.1 MB/s eta 0:00:00
Requirement already satisfied: typing-extensions>=4.6.1 in ./anaconda3/lib/python3.11/site-packages (from pydantic->neural-amp-modeler) (4.6.3)
Requirement already satisfied: PyYAML>=5.4 in ./anaconda3/lib/python3.11/site-packages (from pytorch-lightning->neural-amp-modeler) (6.0)
Requirement already satisfied: fsspec[http]>2021.06.0 in ./anaconda3/lib/python3.11/site-packages (from pytorch-lightning->neural-amp-modeler) (2023.3.0)
Collecting torchmetrics>=0.7.0 (from pytorch-lightning->neural-amp-modeler)
  Downloading torchmetrics-1.0.1-py3-none-any.whl (729 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 729.2/729.2 kB 12.4 MB/s eta 0:00:00
Collecting lightning-utilities>=0.7.0 (from pytorch-lightning->neural-amp-modeler)
  Downloading lightning_utilities-0.9.0-py3-none-any.whl (23 kB)
Requirement already satisfied: filelock in ./anaconda3/lib/python3.11/site-packages (from torch->neural-amp-modeler) (3.9.0)
Requirement already satisfied: sympy in ./anaconda3/lib/python3.11/site-packages (from torch->neural-amp-modeler) (1.11.1)
Requirement already satisfied: networkx in ./anaconda3/lib/python3.11/site-packages (from torch->neural-amp-modeler) (2.8.4)
Requirement already satisfied: jinja2 in ./anaconda3/lib/python3.11/site-packages (from torch->neural-amp-modeler) (3.1.2)
Requirement already satisfied: CFFI>=1.0 in ./anaconda3/lib/python3.11/site-packages (from sounddevice->neural-amp-modeler) (1.15.1)
Collecting absl-py>=0.4 (from tensorboard->neural-amp-modeler)
  Using cached absl_py-1.4.0-py3-none-any.whl (126 kB)
Collecting grpcio>=1.48.2 (from tensorboard->neural-amp-modeler)
  Downloading grpcio-1.56.2-cp311-cp311-macosx_10_10_universal2.whl (8.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 8.9/8.9 MB 21.2 MB/s eta 0:00:00
Collecting google-auth<3,>=1.6.3 (from tensorboard->neural-amp-modeler)
  Downloading google_auth-2.22.0-py2.py3-none-any.whl (181 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 181.8/181.8 kB 5.2 MB/s eta 0:00:00
Collecting google-auth-oauthlib<1.1,>=0.5 (from tensorboard->neural-amp-modeler)
  Using cached google_auth_oauthlib-1.0.0-py2.py3-none-any.whl (18 kB)
Requirement already satisfied: markdown>=2.6.8 in ./anaconda3/lib/python3.11/site-packages (from tensorboard->neural-amp-modeler) (3.4.1)
Collecting protobuf>=3.19.6 (from tensorboard->neural-amp-modeler)
  Downloading protobuf-4.23.4-cp37-abi3-macosx_10_9_universal2.whl (400 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 400.3/400.3 kB 7.3 MB/s eta 0:00:00
Requirement already satisfied: requests<3,>=2.21.0 in ./anaconda3/lib/python3.11/site-packages (from tensorboard->neural-amp-modeler) (2.29.0)
Requirement already satisfied: setuptools>=41.0.0 in ./anaconda3/lib/python3.11/site-packages (from tensorboard->neural-amp-modeler) (67.8.0)
Collecting tensorboard-data-server<0.8.0,>=0.7.0 (from tensorboard->neural-amp-modeler)
  Downloading tensorboard_data_server-0.7.1-py3-none-macosx_10_9_x86_64.whl (4.8 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.8/4.8 MB 17.3 MB/s eta 0:00:00
Requirement already satisfied: werkzeug>=1.0.1 in ./anaconda3/lib/python3.11/site-packages (from tensorboard->neural-amp-modeler) (2.2.3)
Requirement already satisfied: wheel>=0.26 in ./anaconda3/lib/python3.11/site-packages (from tensorboard->neural-amp-modeler) (0.38.4)
Requirement already satisfied: pycparser in ./anaconda3/lib/python3.11/site-packages (from CFFI>=1.0->sounddevice->neural-amp-modeler) (2.21)
Requirement already satisfied: aiohttp!=4.0.0a0,!=4.0.0a1 in ./anaconda3/lib/python3.11/site-packages (from fsspec[http]>2021.06.0->pytorch-lightning->neural-amp-modeler) (3.8.3)
Collecting cachetools<6.0,>=2.0.0 (from google-auth<3,>=1.6.3->tensorboard->neural-amp-modeler)
  Using cached cachetools-5.3.1-py3-none-any.whl (9.3 kB)
Requirement already satisfied: pyasn1-modules>=0.2.1 in ./anaconda3/lib/python3.11/site-packages (from google-auth<3,>=1.6.3->tensorboard->neural-amp-modeler) (0.2.8)
Collecting rsa<5,>=3.1.4 (from google-auth<3,>=1.6.3->tensorboard->neural-amp-modeler)
  Using cached rsa-4.9-py3-none-any.whl (34 kB)
Requirement already satisfied: six>=1.9.0 in ./anaconda3/lib/python3.11/site-packages (from google-auth<3,>=1.6.3->tensorboard->neural-amp-modeler) (1.16.0)
Requirement already satisfied: urllib3<2.0 in ./anaconda3/lib/python3.11/site-packages (from google-auth<3,>=1.6.3->tensorboard->neural-amp-modeler) (1.26.16)
Collecting requests-oauthlib>=0.7.0 (from google-auth-oauthlib<1.1,>=0.5->tensorboard->neural-amp-modeler)
  Using cached requests_oauthlib-1.3.1-py2.py3-none-any.whl (23 kB)
Requirement already satisfied: charset-normalizer<4,>=2 in ./anaconda3/lib/python3.11/site-packages (from requests<3,>=2.21.0->tensorboard->neural-amp-modeler) (2.0.4)
Requirement already satisfied: idna<4,>=2.5 in ./anaconda3/lib/python3.11/site-packages (from requests<3,>=2.21.0->tensorboard->neural-amp-modeler) (3.4)
Requirement already satisfied: certifi>=2017.4.17 in ./anaconda3/lib/python3.11/site-packages (from requests<3,>=2.21.0->tensorboard->neural-amp-modeler) (2023.5.7)
Requirement already satisfied: MarkupSafe>=2.1.1 in ./anaconda3/lib/python3.11/site-packages (from werkzeug>=1.0.1->tensorboard->neural-amp-modeler) (2.1.1)
Requirement already satisfied: mpmath>=0.19 in ./anaconda3/lib/python3.11/site-packages (from sympy->torch->neural-amp-modeler) (1.2.1)
Requirement already satisfied: attrs>=17.3.0 in ./anaconda3/lib/python3.11/site-packages (from aiohttp!=4.0.0a0,!=4.0.0a1->fsspec[http]>2021.06.0->pytorch-lightning->neural-amp-modeler) (22.1.0)
Requirement already satisfied: multidict<7.0,>=4.5 in ./anaconda3/lib/python3.11/site-packages (from aiohttp!=4.0.0a0,!=4.0.0a1->fsspec[http]>2021.06.0->pytorch-lightning->neural-amp-modeler) (6.0.2)
Requirement already satisfied: async-timeout<5.0,>=4.0.0a3 in ./anaconda3/lib/python3.11/site-packages (from aiohttp!=4.0.0a0,!=4.0.0a1->fsspec[http]>2021.06.0->pytorch-lightning->neural-amp-modeler) (4.0.2)
Requirement already satisfied: yarl<2.0,>=1.0 in ./anaconda3/lib/python3.11/site-packages (from aiohttp!=4.0.0a0,!=4.0.0a1->fsspec[http]>2021.06.0->pytorch-lightning->neural-amp-modeler) (1.8.1)
Requirement already satisfied: frozenlist>=1.1.1 in ./anaconda3/lib/python3.11/site-packages (from aiohttp!=4.0.0a0,!=4.0.0a1->fsspec[http]>2021.06.0->pytorch-lightning->neural-amp-modeler) (1.3.3)
Requirement already satisfied: aiosignal>=1.1.2 in ./anaconda3/lib/python3.11/site-packages (from aiohttp!=4.0.0a0,!=4.0.0a1->fsspec[http]>2021.06.0->pytorch-lightning->neural-amp-modeler) (1.2.0)
Requirement already satisfied: pyasn1<0.5.0,>=0.4.6 in ./anaconda3/lib/python3.11/site-packages (from pyasn1-modules>=0.2.1->google-auth<3,>=1.6.3->tensorboard->neural-amp-modeler) (0.4.8)
Collecting oauthlib>=3.0.0 (from requests-oauthlib>=0.7.0->google-auth-oauthlib<1.1,>=0.5->tensorboard->neural-amp-modeler)
  Using cached oauthlib-3.2.2-py3-none-any.whl (151 kB)
Installing collected packages: wavio, tensorboard-data-server, rsa, pydantic-core, protobuf, oauthlib, lightning-utilities, grpcio, cachetools, annotated-types, absl-py, torch, sounddevice, requests-oauthlib, pydantic, google-auth, torchmetrics, google-auth-oauthlib, auraloss, tensorboard, pytorch-lightning, neural-amp-modeler
Successfully installed absl-py-1.4.0 annotated-types-0.5.0 auraloss-0.3.0 cachetools-5.3.1 google-auth-2.22.0 google-auth-oauthlib-1.0.0 grpcio-1.56.2 lightning-utilities-0.9.0 neural-amp-modeler-0.7.0 oauthlib-3.2.2 protobuf-4.23.4 pydantic-2.1.1 pydantic-core-2.4.0 pytorch-lightning-2.0.6 requests-oauthlib-1.3.1 rsa-4.9 sounddevice-0.4.6 tensorboard-2.13.0 tensorboard-data-server-0.7.1 torch-2.0.1 torchmetrics-1.0.1 wavio-0.0.7
(base) steve@Stevens-MacBook-Pro ~ % nam
Traceback (most recent call last):
  File "/Users/steve/anaconda3/bin/nam", line 5, in <module>
    from nam.train.gui import run
  File "/Users/steve/anaconda3/lib/python3.11/site-packages/nam/__init__.py", line 23, in <module>
    from . import models  # noqa F401
    ^^^^^^^^^^^^^^^^^^^^
  File "/Users/steve/anaconda3/lib/python3.11/site-packages/nam/models/__init__.py", line 9, in <module>
    from .base import Model  # noqa F401
    ^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/steve/anaconda3/lib/python3.11/site-packages/nam/models/base.py", line 19, in <module>
    import pytorch_lightning as pl
  File "/Users/steve/anaconda3/lib/python3.11/site-packages/pytorch_lightning/__init__.py", line 26, in <module>
    from pytorch_lightning.callbacks import Callback  # noqa: E402
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/steve/anaconda3/lib/python3.11/site-packages/pytorch_lightning/callbacks/__init__.py", line 14, in <module>
    from pytorch_lightning.callbacks.batch_size_finder import BatchSizeFinder
  File "/Users/steve/anaconda3/lib/python3.11/site-packages/pytorch_lightning/callbacks/batch_size_finder.py", line 24, in <module>
    from pytorch_lightning.callbacks.callback import Callback
  File "/Users/steve/anaconda3/lib/python3.11/site-packages/pytorch_lightning/callbacks/callback.py", line 22, in <module>
    from pytorch_lightning.utilities.types import STEP_OUTPUT
  File "/Users/steve/anaconda3/lib/python3.11/site-packages/pytorch_lightning/utilities/types.py", line 25, in <module>
    from torchmetrics import Metric
  File "/Users/steve/anaconda3/lib/python3.11/site-packages/torchmetrics/__init__.py", line 14, in <module>
    from torchmetrics import functional  # noqa: E402
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/steve/anaconda3/lib/python3.11/site-packages/torchmetrics/functional/__init__.py", line 121, in <module>
    from torchmetrics.functional.text._deprecated import _bleu_score as bleu_score
  File "/Users/steve/anaconda3/lib/python3.11/site-packages/torchmetrics/functional/text/__init__.py", line 31, in <module>
    from torchmetrics.functional.text.bert import bert_score
  File "/Users/steve/anaconda3/lib/python3.11/site-packages/torchmetrics/functional/text/bert.py", line 25, in <module>
    from torchmetrics.functional.text.helper_embedding_metric import (
  File "/Users/steve/anaconda3/lib/python3.11/site-packages/torchmetrics/functional/text/helper_embedding_metric.py", line 27, in <module>
    from transformers import AutoModelForMaskedLM, AutoTokenizer, PreTrainedModel, PreTrainedTokenizerBase
ImportError: cannot import name 'AutoModelForMaskedLM' from 'transformers' (/Users/steve/anaconda3/lib/python3.11/site-packages/transformers/__init__.py)
(base) steve@Stevens-MacBook-Pro ~ % 

Expected behavior
The NAM trainer should open

Screenshots
N/A

Desktop (please complete the following information):

  • Computer: MacBook Pro, 13-inch, 2020, Four Thunderbolt 3 ports
  • OS: macOS 13.4.1 (c)
  • Running locally
  • Package version: neural-amp-modeler 0.7.0 via PyPI.

Additional context
Add any other context about the problem here.

@sdatkinson sdatkinson added bug Something isn't working priority:low Low-priority issues priority:high Prioritize and removed priority:low Low-priority issues labels Jul 27, 2023
@sdatkinson
Copy link
Owner Author

Interesting: transformers now gets pulled in as a dependency:

(base) steve@Stevens-MacBook-Pro ~ % pip list | grep transformers
transformers                  2.1.1

I believe this is new. The cause seems to be from torchmetrics. I see this related bug: Lightning-AI/torchmetrics#1742

I can replace the nugget of the issue like this:

(base) steve@Stevens-MacBook-Pro ~ % python 
Python 3.11.3 (main, Apr 19 2023, 18:51:09) [Clang 14.0.6 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from transformers import AutoModelForMaskedLM
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'AutoModelForMaskedLM' from 'transformers' (/Users/steve/anaconda3/lib/python3.11/site-packages/transformers/__init__.py)

First thing I'm going to try is check the version of transformers that torchmetrics wants. I bet it's not upper-bounded and a new version came out that broke compatibility for torchmetrics.

@sdatkinson
Copy link
Owner Author

Found two fixes:

  • pip install --upgrade transformers -- updates to 4.31.0 as of this writing.
  • pip uninstall transformers -- because it's not needed.

It seems that the root cause is that transformers was actually too old. I wonder if it comes pre-installed (way out of date) with Anaconda now?

If so, the fix is to add this logic to setup.py:

  1. Check if it's installed.
  2. If it is, then require it be up to date enough.
  3. If not, then don't bother.

@sdatkinson
Copy link
Owner Author

Didn't work when installing from PyPI; reopening

@sdatkinson
Copy link
Owner Author

Whew

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority:high Prioritize
Projects
None yet
1 participant