Code Monkey home page Code Monkey logo

mtlmusicrepresentation-pytorch's People

Contributors

eldrin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

kiminh

mtlmusicrepresentation-pytorch's Issues

Having issues running your code

Hi Eldrin,

after reading your paper, I was hoping that I could play with your code a bit, but that appears quite difficult. I'm not entirely sure if a github issue is the best way for this, please let me know if you prefer a different mode of contact. I tried to start by running the scripts/ext_feat.py script that you mention in the readme. Here is a list of the different issues I'm facing:

  1. torch==1.13.0+cu116 has no installation candidate, so I modified the requirements.txt to only refer to torch==1.13.0.
  2. Next, the definition of DEFAULT_SCALER_REF in musmtl/model.py line 9 is broken. I'm getting an AttributeError: module 'importlib.resources' has no attribute 'files'. However, it appears that pretty much no other place in the code is referencing this, except for line 327 in musmtl/tool.py and that use is inside a main function that isn't used by the scripts/ext_feat.py script. So I decided to set DEFAULT_SCALER_REF=None and move on.
  3. That gives me a couple of TypeErrors in musmtl/utils.py. All of them are related to type hints and are easy to fix (from typing import Tuple, List and then tuple[...] -> Tuple[...], list[...] -> List[...]).
  4. However, then I run into an issue that I am not able to resolve: musmtl/tool.py on line 92 uses np.load on the scaler_fn, which points to the file models/sclr_dbmel.dat.gz. Here, I get the following error message:
Traceback (most recent call last):
  File "scripts/ext_feat.py", line 47, in <module>
    for feature, fn in zip(ext.run(model_fns, SCALER_FN), model_fns):
  File "/home/ingo/code/MTLMusicRepresentation-PyTorch/scripts/../musmtl/tool.py", line 163, in run
    scaler, model = self._load_model(model_fn, scaler_fn, self.device)
  File "/home/ingo/code/MTLMusicRepresentation-PyTorch/scripts/../musmtl/tool.py", line 92, in _load_model
    with np.load(scaler_fn) as npf:
  File "/home/ingo/code/MTLMusicRepresentation-PyTorch/.venv/lib/python3.8/site-packages/numpy/lib/npyio.py", line 445, in load
    raise ValueError("Cannot load file containing pickled data "
ValueError: Cannot load file containing pickled data when allow_pickle=False

Of course, I tried to set allow_pickle=True, but the file doesn't appear to actually be a pickle file:

Traceback (most recent call last):
  File "/home/ingo/code/MTLMusicRepresentation-PyTorch/.venv/lib/python3.8/site-packages/numpy/lib/npyio.py", line 448, in load
    return pickle.load(fid, **pickle_kwargs)
_pickle.UnpicklingError: invalid load key, '\x1f'.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "scripts/ext_feat.py", line 47, in <module>
    for feature, fn in zip(ext.run(model_fns, SCALER_FN), model_fns):
  File "/home/ingo/code/MTLMusicRepresentation-PyTorch/scripts/../musmtl/tool.py", line 163, in run
    scaler, model = self._load_model(model_fn, scaler_fn, self.device)
  File "/home/ingo/code/MTLMusicRepresentation-PyTorch/scripts/../musmtl/tool.py", line 92, in _load_model
    with np.load(scaler_fn, allow_pickle=True) as npf:
  File "/home/ingo/code/MTLMusicRepresentation-PyTorch/.venv/lib/python3.8/site-packages/numpy/lib/npyio.py", line 450, in load
    raise IOError(
OSError: Failed to interpret file 'scripts/../models/sclr_dbmel.dat.gz' as a pickle

I have a feeling that it might be related to line 91 in musmtl/tool.py, where a joblib load command is commented out, but I don't know how to fit the two together. Can you give me a pointer?

Would it help if I made a pull request with my changes?

Also, I find it very difficult to make sense of the different checkpoints in the data.zip file that the readme references. There are almost 400 checkpoint folders in mtl_dataset/mtlmodel_release. Which one is good? Which one(s) is the paper based on?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.