Problems Installing m2d
I am attempting to install m2d and I am having some trouble. I do not know what to do after cloning the file. The patch command does not work as given and my python installation cannot find the module.
Thanks in advance
@mmalesevic1 Hello, thanks for your interest. Please specifically copy and paste the error message here so that we can see the problem. Everything should work under a standard Linux (specifically Ubuntu) environment.
Unfortunately, I do not have a test environment for Windows, while I guess it should work in bash on Windows. On Mac, I think I have tried on my Mac.
Thank you for your reply. I am working in a Mac conda environment, to which I installed the requirements as specified. when I try to patch, it asks me for a file to patch like this:
remote: Total 307 (delta 150), reused 243 (delta 88), pack-reused 0 (from 0) Receiving objects: 100% (307/307), 16.75 MiB | 5.60 MiB/s, done. Resolving deltas: 100% (150/150), done. (env) (base) @.*** thesis % patch -p1 < patch_m2d.diff zsh: no such file or directory: patch_m2d.diff (env) (base) @.*** thesis % cd m2d (env) (base) @.*** m2d % patch -p1 < patch_m2d.diff File to patch: * No file found--skip this patch? [n] y 9 out of 9 hunks ignored--saving rejects to '*.rej' patching file 'clap/train_clap.py' Reversed (or previously applied) patch detected! Assume -R? [y] y
Thank you in advance
On Wed, Jul 23, 2025 at 12:47 AM Daisuke Niizumi @.***> wrote:
daisukelab left a comment (nttcslab/m2d#9) https://github.com/nttcslab/m2d/issues/9#issuecomment-3105039891
@mmalesevic1 https://github.com/mmalesevic1 Hello, thanks for your interest. Please specifically copy and paste the error message here so that we can see the problem. Everything should work under a standard Linux (specifically Ubuntu) environment.
Unfortunately, I do not have a test environment for Windows, while I guess it should work in bash on Windows. On Mac, I think I have tried on my Mac.
— Reply to this email directly, view it on GitHub https://github.com/nttcslab/m2d/issues/9#issuecomment-3105039891, or unsubscribe https://github.com/notifications/unsubscribe-auth/AST5QUIVKB5ZPKPXZF2Z4E33J25QTAVCNFSM6AAAAACCDP52PGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTCMBVGAZTSOBZGE . You are receiving this because you were mentioned.Message ID: @.***>
@mmalesevic1 Thank you for the details. I guess downloading files may have failed.
The following is my log for running "1. Download external source files and apply a patch" in https://github.com/nttcslab/m2d?tab=readme-ov-file#1-setup
Please confirm the difference in your log at your environment.
My guess is that the curl commands may have failed.
Could you check if util/lars.py is downloaded successfully, for example?
P.S. curl may not have been installed by default. I may have done: "brew install curl".
Cloning into 'm2d'...
remote: Enumerating objects: 307, done.
remote: Counting objects: 100% (307/307), done.
remote: Compressing objects: 100% (198/198), done.
remote: Total 307 (delta 150), reused 243 (delta 88), pack-reused 0 (from 0)
Receiving objects: 100% (307/307), 16.75 MiB | 6.20 MiB/s, done.
Resolving deltas: 100% (150/150), done.
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1851 100 1851 0 0 2252 0 --:--:-- --:--:-- --:--:-- 2251
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 2461 100 2461 0 0 9004 0 --:--:-- --:--:-- --:--:-- 9014
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 802 100 802 0 0 2572 0 --:--:-- --:--:-- --:--:-- 2570
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 11440 100 11440 0 0 45216 0 --:--:-- --:--:-- --:--:-- 45396
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 2507 100 2507 0 0 7357 0 --:--:-- --:--:-- --:--:-- 7373
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 4047 100 4047 0 0 14413 0 --:--:-- --:--:-- --:--:-- 14402
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 8860 100 8860 0 0 33932 0 --:--:-- --:--:-- --:--:-- 33946
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 8860 100 8860 0 0 199k 0 --:--:-- --:--:-- --:--:-- 201k
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 8860 100 8860 0 0 213k 0 --:--:-- --:--:-- --:--:-- 216k
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 8860 100 8860 0 0 146k 0 --:--:-- --:--:-- --:--:-- 149k
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 8860 100 8860 0 0 243k 0 --:--:-- --:--:-- --:--:-- 247k
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 3000 100 3000 0 0 12338 0 --:--:-- --:--:-- --:--:-- 12295
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 9742 100 9742 0 0 25646 0 --:--:-- --:--:-- --:--:-- 25704
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 2384 100 2384 0 0 8815 0 --:--:-- --:--:-- --:--:-- 8829
patching file train_audio.py
patching file clap/train_clap.py
patching file speech/train_speech.py
patching file audioset/train_as.py
patching file util/misc.py
patching file m2d/engine_pretrain_m2d.py
patching file m2d/models_mae.py
patching file m2d/pos_embed.py
patching file m2d/timm_layers_pos_embed.py
patching file mae_train_audio.py
Thank you once again for your reply.
I have replicated your output, but when I try to run the sample load and encode code, the import line throws a no module named m2d error. Is there maybe a separate pip install step not mentioned in the docs?
On Thu, Jul 24, 2025 at 1:18 PM Daisuke Niizumi @.***> wrote:
daisukelab left a comment (nttcslab/m2d#9) https://github.com/nttcslab/m2d/issues/9#issuecomment-3113071578
@mmalesevic1 https://github.com/mmalesevic1 Thank you for the details. I guess downloading files may have failed.
The following is my log for running "1. Download external source files and apply a patch" in https://github.com/nttcslab/m2d?tab=readme-ov-file#1-setup
Please confirm the difference in your log at your environment. My guess is that the curl commands may have failed. Could you check if util/lars.py is downloaded successfully, for example?
Cloning into 'm2d'... remote: Enumerating objects: 307, done. remote: Counting objects: 100% (307/307), done. remote: Compressing objects: 100% (198/198), done. remote: Total 307 (delta 150), reused 243 (delta 88), pack-reused 0 (from 0) Receiving objects: 100% (307/307), 16.75 MiB | 6.20 MiB/s, done. Resolving deltas: 100% (150/150), done. % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 1851 100 1851 0 0 2252 0 --:--:-- --:--:-- --:--:-- 2251 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 2461 100 2461 0 0 9004 0 --:--:-- --:--:-- --:--:-- 9014 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 802 100 802 0 0 2572 0 --:--:-- --:--:-- --:--:-- 2570 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 11440 100 11440 0 0 45216 0 --:--:-- --:--:-- --:--:-- 45396 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 2507 100 2507 0 0 7357 0 --:--:-- --:--:-- --:--:-- 7373 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 4047 100 4047 0 0 14413 0 --:--:-- --:--:-- --:--:-- 14402 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 8860 100 8860 0 0 33932 0 --:--:-- --:--:-- --:--:-- 33946 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 8860 100 8860 0 0 199k 0 --:--:-- --:--:-- --:--:-- 201k % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 8860 100 8860 0 0 213k 0 --:--:-- --:--:-- --:--:-- 216k % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 8860 100 8860 0 0 146k 0 --:--:-- --:--:-- --:--:-- 149k % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 8860 100 8860 0 0 243k 0 --:--:-- --:--:-- --:--:-- 247k % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 3000 100 3000 0 0 12338 0 --:--:-- --:--:-- --:--:-- 12295 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 9742 100 9742 0 0 25646 0 --:--:-- --:--:-- --:--:-- 25704 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 2384 100 2384 0 0 8815 0 --:--:-- --:--:-- --:--:-- 8829 patching file train_audio.py patching file clap/train_clap.py patching file speech/train_speech.py patching file audioset/train_as.py patching file util/misc.py patching file m2d/engine_pretrain_m2d.py patching file m2d/models_mae.py patching file m2d/pos_embed.py patching file m2d/timm_layers_pos_embed.py patching file mae_train_audio.py
— Reply to this email directly, view it on GitHub https://github.com/nttcslab/m2d/issues/9#issuecomment-3113071578, or unsubscribe https://github.com/notifications/unsubscribe-auth/AST5QUPPRCLGVNI6BMJP6GT3KC6JDAVCNFSM6AAAAACCDP52PGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTCMJTGA3TCNJXHA . You are receiving this because you were mentioned.Message ID: @.***>
@mmalesevic1 Examples that should reproduce are the Colab examples, such as: http://colab.research.google.com/github/nttcslab/m2d/blob/master/examples/Colab_M2D_example_Tagging.ipynb
Other examples can be found here: https://github.com/nttcslab/m2d?tab=readme-ov-file#quick-start
For more pinpointed troubleshooting, I would need a log; however, I guess you might want to check the following:
- The folder you run.
- You are using portable_m2d.py.
- Path to the weight.
Maybe you are using runtime_audio.py and facing the first problem.
Hope it helps...