symphonynet/SymphonyNet

undefined symbol in Colab

Closed this issue · 4 comments

Hi!

I'm triying to run inference in Colab in both CPU and GPU mode, but I'm getting an error. The Colab code is as simple as possible: Clone the repo, copy the checkpoint file, install requirements, try to run inference (I've tried with a simple prime midi file and with no file)

%cd /content/drive/MyDrive/AI
!git clone https://github.com/symphonynet/SymphonyNet.git
!cp /content/drive/MyDrive/Art/Models/SymphonyNet/checkpoint_last_linear_4096_chord_bpe_hardloss1_PI2.pt /content/drive/MyDrive/AI/SymphonyNet/ckpt 

%cd /content/drive/MyDrive/AI/SymphonyNet
!pip install -r requirements.txt

%cd /content/drive/MyDrive/AI/SymphonyNet/src/fairseq
!python gen_batch.py test.mid

And this is the error I'm getting:

Traceback (most recent call last):
  File "gen_batch.py", line 85, in <module>
    user_dir="linear_transformer_inference" + ("" if NEW_VER == 1 else "_old"))
  File "/usr/local/lib/python3.7/dist-packages/fairseq/models/fairseq_model.py", line 266, in from_pretrained
    **kwargs,
  File "/usr/local/lib/python3.7/dist-packages/fairseq/hub_utils.py", line 68, in from_pretrained
    utils.import_user_module(argparse.Namespace(user_dir=kwargs["user_dir"]))
  File "/usr/local/lib/python3.7/dist-packages/fairseq/utils.py", line 456, in import_user_module
    importlib.import_module(module_name)
  File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/content/drive/MyDrive/AI/SymphonyNet/src/fairseq/linear_transformer_inference/__init__.py", line 1, in <module>
    from . import linear_transformer_multi
  File "/content/drive/MyDrive/AI/SymphonyNet/src/fairseq/linear_transformer_inference/linear_transformer_multi.py", line 1, in <module>
    from fast_transformers.builders import TransformerEncoderBuilder, RecurrentEncoderBuilder
  File "/usr/local/lib/python3.7/dist-packages/fast_transformers/builders/__init__.py", line 42, in <module>
    from ..attention import \
  File "/usr/local/lib/python3.7/dist-packages/fast_transformers/attention/__init__.py", line 13, in <module>
    from .causal_linear_attention import CausalLinearAttention
  File "/usr/local/lib/python3.7/dist-packages/fast_transformers/attention/causal_linear_attention.py", line 15, in <module>
    from ..causal_product import causal_dot_product
  File "/usr/local/lib/python3.7/dist-packages/fast_transformers/causal_product/__init__.py", line 9, in <module>
    from .causal_product_cpu import causal_dot_product as causal_dot_product_cpu, \
ImportError: /usr/local/lib/python3.7/dist-packages/fast_transformers/causal_product/causal_product_cpu.cpython-37m-x86_64-linux-gnu.so: undefined symbol: _ZN3c106detail14torchCheckFailEPKcS2_jS2_

Can you help, please? I'm really interested in testing your model. Thanks in advance.

Unfortunately I am getting the same error. I would really love to check out your model!

pip install pytorch-fast-transformers==0.3.0 can solve this problem

Thanks. I've tried that and now I'm getting a file not found error:

Traceback (most recent call last):
  File "gen_batch.py", line 85, in <module>
    user_dir="linear_transformer_inference" + ("" if NEW_VER == 1 else "_old"))
  File "/usr/local/lib/python3.7/dist-packages/fairseq/models/fairseq_model.py", line 266, in from_pretrained
    **kwargs,
  File "/usr/local/lib/python3.7/dist-packages/fairseq/hub_utils.py", line 72, in from_pretrained
    arg_overrides=kwargs,
  File "/usr/local/lib/python3.7/dist-packages/fairseq/checkpoint_utils.py", line 283, in load_model_ensemble_and_task
    task = tasks.setup_task(args)
  File "/usr/local/lib/python3.7/dist-packages/fairseq/tasks/__init__.py", line 28, in setup_task
    return TASK_REGISTRY[task_cfg.task].setup_task(task_cfg, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/fairseq/tasks/language_modeling.py", line 158, in setup_task
    dictionary, output_dictionary = cls.setup_dictionary(args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/fairseq/tasks/language_modeling.py", line 142, in setup_dictionary
    dictionary = Dictionary.load(os.path.join(paths[0], "dict.txt"))
  File "/usr/local/lib/python3.7/dist-packages/fairseq/data/dictionary.py", line 214, in load
    d.add_from_file(f)
  File "/usr/local/lib/python3.7/dist-packages/fairseq/data/dictionary.py", line 227, in add_from_file
    raise fnfe
  File "/usr/local/lib/python3.7/dist-packages/fairseq/data/dictionary.py", line 224, in add_from_file
    with open(PathManager.get_local_path(f), "r", encoding="utf-8") as fd:
FileNotFoundError: [Errno 2] No such file or directory: '/content/drive/MyDrive/AI/SymphonyNet/data/model_spec/linear_4096_chord_bpe_hardloss1/bin/dict.txt'

Everything is working now, using you Colab. Thank you very much!