kkoutini / PaSST

Efficient Training of Audio Transformers with Patchout
Apache License 2.0
287 stars 48 forks source link

mismatch version of pytorch-lighting and sarced #16

Open Junglesl opened 2 years ago

Junglesl commented 2 years ago

Hello,when I after running the code following,

微信图片_20220426144143

and I run the code

微信图片_20220426144415

but I encontered the issue:

微信图片_20220426144634 微信图片_20220426144639

Is this the wrong version of pytorch-lighting and sarced?When I upgrad the pytorch-lighting to the latest version,the issue is solved but the issue with sacred has not been solved. Could you please provide some help?Thank you very much!

kkoutini commented 2 years ago

Hi, can you report the output of this command:

pip list | grep sacred

maybe running :

pip install -e 'git+https://github.com/kkoutini/sacred@v0.0.1#egg=sacred' 

should install the correct sacred version.

Junglesl commented 2 years ago

Hi, can you report the output of this command:

pip list | grep sacred

maybe running :

pip install -e 'git+https://github.com/kkoutini/sacred@v0.0.1#egg=sacred' 

should install the correct sacred version.

I reinstalled sacred as you suggested and the output of pip list | grep sacred is as follows:

微信图片_20220428150236

This version should be correct. I have another question:is the audio input is normalized to [-1,1] before they enter your model? I want to verify this because this is important. Thank you very much!

kkoutini commented 2 years ago

I think you need to uninstall sacred first:

 pip uninstall -y sacred  &&  pip install -e 'git+https://github.com/kkoutini/sacred@v0.0.1#egg=sacred'

you can check wether you have the correct version like this:

 python -c "from sacred.config_helpers import CMD"

yes the model expects the range [-1,1]

Junglesl commented 2 years ago

I think you need to uninstall sacred first:

 pip uninstall -y sacred  &&  pip install -e 'git+https://github.com/kkoutini/sacred@v0.0.1#egg=sacred'

you can check wether you have the correct version like this:

python -c "from sacred.config_helpers import CMD"

yes the model expects the range [-1,1]

Thank you very much! I will try your suggestion. I have two other questiones and I need your suggestions.

  1. I pip the model passt_hear21 as suggests and I use the model weight passt-s-f128-p16-s10-ap.476-swa.pt, 微信图片_20220428192827

    and I run the following recommanded code in passt_hear21:

    1651145444(1)

    it runs successfully.But when I change the audio input to audio = torch.ones((1, 32000 seconds))0.5,there is a segmentation fault. when I change the input audio to audio = torch.ones((5, 32000 seconds))0.5, the following error occurred:

/home/jovyan/miniconda3/envs/ba3l/lib/python3.7/site-packages/torch/functional.py:581: UserWarning: stft will soon require the return_complex parameter be given for real inputs, and will further require that return_complex=True in a future PyTorch release. (Triggered internally at /pytorch/aten/src/ATen/native/SpectralOps.cpp:639.) normalized, onesided, return_complex) x torch.Size([5, 1, 128, 16]) /home/jovyan/miniconda3/envs/ba3l/lib/python3.7/site-packages/hear21passt/models/passt.py:260: UserWarning: Input image size (12816) doesn't match model (128998). warnings.warn(f"Input image size ({H}{W}) doesn't match model ({self.img_size[0]}{self.img_size[1]}).") self.norm(x) torch.Size([5, 768, 12, 1]) patch_embed : torch.Size([5, 768, 12, 1]) self.time_new_pos_embed.shape torch.Size([1, 768, 1, 99]) CUT time_new_pos_embed.shape torch.Size([1, 768, 1, 1]) self.freq_new_pos_embed.shape torch.Size([1, 768, 12, 1]) X flattened torch.Size([5, 12, 768]) self.new_pos_embed.shape torch.Size([1, 2, 768]) self.cls_tokens.shape torch.Size([5, 1, 768]) self.dist_token.shape torch.Size([5, 1, 768]) final sequence x torch.Size([5, 14, 768]) Traceback (most recent call last): File "default.py", line 19, in embed, time_stamps = get_timestamp_embeddings(audio, model) File "/home/jovyan/miniconda3/envs/ba3l/lib/python3.7/site-packages/hear21passt/base.py", line 35, in get_timestamp_embeddings return get_basic_timestamp_embeddings(audio, model) File "/home/jovyan/miniconda3/envs/ba3l/lib/python3.7/site-packages/hear21passt/base.py", line 48, in get_basic_timestamp_embeddings return model.get_timestamp_embeddings(audio) File "/home/jovyan/miniconda3/envs/ba3l/lib/python3.7/site-packages/hear21passt/wrapper.py", line 91, in get_timestamp_embeddings embeddings.append(self.forward(segment.to(self.device())).cpu()) File "/home/jovyan/miniconda3/envs/ba3l/lib/python3.7/site-packages/hear21passt/wrapper.py", line 38, in forward x, features = self.net(specs) File "/home/jovyan/miniconda3/envs/ba3l/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(*input, kwargs) File "/home/jovyan/miniconda3/envs/ba3l/lib/python3.7/site-packages/hear21passt/models/passt.py", line 503, in forward x = self.forward_features(x) File "/home/jovyan/miniconda3/envs/ba3l/lib/python3.7/site-packages/hear21passt/models/passt.py", line 491, in forward_features x = self.blocks(x) File "/home/jovyan/miniconda3/envs/ba3l/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(*input, *kwargs) File "/home/jovyan/miniconda3/envs/ba3l/lib/python3.7/site-packages/torch/nn/modules/container.py", line 119, in forward input = module(input) File "/home/jovyan/miniconda3/envs/ba3l/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(input, kwargs) File "/home/jovyan/miniconda3/envs/ba3l/lib/python3.7/site-packages/hear21passt/models/passt.py", line 312, in forward x = x + self.drop_path(self.mlp(self.norm2(x))) File "/home/jovyan/miniconda3/envs/ba3l/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(*input, *kwargs) File "/home/jovyan/miniconda3/envs/ba3l/lib/python3.7/site-packages/hear21passt/models/passt.py", line 226, in forward x = self.fc1(x) File "/home/jovyan/miniconda3/envs/ba3l/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(input, **kwargs) File "/home/jovyan/miniconda3/envs/ba3l/lib/python3.7/site-packages/torch/nn/modules/linear.py", line 94, in forward return F.linear(input, self.weight, self.bias) File "/home/jovyan/miniconda3/envs/ba3l/lib/python3.7/site-packages/torch/nn/functional.py", line 1753, in linear return torch._C._nn.linear(input, weight, bias) RuntimeError: CUDA error: CUBLAS_STATUS_EXECUTION_FAILED when calling cublasSgemm( handle, opa, opb, m, n, k, &alpha, a, lda, b, ldb, &beta, c, ldc) I want to know whether the number 3 represents batch size? And why can't it changed to other numbers? 2.The input of the recommanded code is a 15s audio, I want to know what is the longest audio that can be input to the model? Thank you very much!

Junglesl commented 2 years ago

I think you need to uninstall sacred first:

 pip uninstall -y sacred  &&  pip install -e 'git+https://github.com/kkoutini/sacred@v0.0.1#egg=sacred'

you can check wether you have the correct version like this:

python -c "from sacred.config_helpers import CMD"

yes the model expects the range [-1,1]

Thank you very much! I will try your suggestion. I have three other questiones and I need your suggestions.

  1. I pip the model passt_hear21 as suggests and I use the model weight passt-s-f128-p16-s10-ap.476-swa.pt,
微信图片_20220428192827

and I run the following recommanded code in passt_hear21:

1651145444(1)

it runs successfully.But when I change the audio input to audio = torch.ones((1, 32000 seconds))0.5,there is a segmentation fault. when I change the input audio to audio = torch.ones((5, 32000 seconds))0.5, the following error occurred: /home/jovyan/miniconda3/envs/ba3l/lib/python3.7/site-packages/torch/functional.py:581: UserWarning: stft will soon require the return_complex parameter be given for real inputs, and will further require that return_complex=True in a future PyTorch release. (Triggered internally at /pytorch/aten/src/ATen/native/SpectralOps.cpp:639.) normalized, onesided, return_complex) x torch.Size([5, 1, 128, 16]) /home/jovyan/miniconda3/envs/ba3l/lib/python3.7/site-packages/hear21passt/models/passt.py:260: UserWarning: Input image size (128_16) doesn't match model (128998). warnings.warn(f"Input image size ({H}{W}) doesn't match model ({self.imgsize[0]}{self.img_size[1]}).") self.norm(x) torch.Size([5, 768, 12, 1]) patch_embed : torch.Size([5, 768, 12, 1]) self.time_new_pos_embed.shape torch.Size([1, 768, 1, 99]) CUT time_new_pos_embed.shape torch.Size([1, 768, 1, 1]) self.freq_new_pos_embed.shape torch.Size([1, 768, 12, 1]) X flattened torch.Size([5, 12, 768]) self.new_pos_embed.shape torch.Size([1, 2, 768]) self.cls_tokens.shape torch.Size([5, 1, 768]) self.dist_token.shape torch.Size([5, 1, 768]) final sequence x torch.Size([5, 14, 768]) Traceback (most recent call last): File "default.py", line 19, in embed, time_stamps = get_timestamp_embeddings(audio, model) File "/home/jovyan/miniconda3/envs/ba3l/lib/python3.7/site-packages/hear21passt/base.py", line 35, in get_timestamp_embeddings return get_basic_timestamp_embeddings(audio, model) File "/home/jovyan/miniconda3/envs/ba3l/lib/python3.7/site-packages/hear21passt/base.py", line 48, in get_basic_timestamp_embeddings return model.get_timestamp_embeddings(audio) File "/home/jovyan/miniconda3/envs/ba3l/lib/python3.7/site-packages/hear21passt/wrapper.py", line 91, in get_timestamp_embeddings embeddings.append(self.forward(segment.to(self.device())).cpu()) File "/home/jovyan/miniconda3/envs/ba3l/lib/python3.7/site-packages/hear21passt/wrapper.py", line 38, in forward x, features = self.net(specs) File "/home/jovyan/miniconda3/envs/ba3l/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(*input, kwargs) File "/home/jovyan/miniconda3/envs/ba3l/lib/python3.7/site-packages/hear21passt/models/passt.py", line 503, in forward x = self.forward_features(x) File "/home/jovyan/miniconda3/envs/ba3l/lib/python3.7/site-packages/hear21passt/models/passt.py", line 491, in forward_features x = self.blocks(x) File "/home/jovyan/miniconda3/envs/ba3l/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(*input, *kwargs) File "/home/jovyan/miniconda3/envs/ba3l/lib/python3.7/site-packages/torch/nn/modules/container.py", line 119, in forward input = module(input) File "/home/jovyan/miniconda3/envs/ba3l/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(input, kwargs) File "/home/jovyan/miniconda3/envs/ba3l/lib/python3.7/site-packages/hear21passt/models/passt.py", line 312, in forward x = x + self.drop_path(self.mlp(self.norm2(x))) File "/home/jovyan/miniconda3/envs/ba3l/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(*input, *kwargs) File "/home/jovyan/miniconda3/envs/ba3l/lib/python3.7/site-packages/hear21passt/models/passt.py", line 226, in forward x = self.fc1(x) File "/home/jovyan/miniconda3/envs/ba3l/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(input, **kwargs) File "/home/jovyan/miniconda3/envs/ba3l/lib/python3.7/site-packages/torch/nn/modules/linear.py", line 94, in forward return F.linear(input, self.weight, self.bias) File "/home/jovyan/miniconda3/envs/ba3l/lib/python3.7/site-packages/torch/nn/functional.py", line 1753, in linear return torch._C._nn.linear(input, weight, bias) RuntimeError: CUDA error: CUBLAS_STATUS_EXECUTION_FAILED when calling cublasSgemm( handle, opa, opb, m, n, k, &alpha, a, lda, b, ldb, &beta, c, ldc)

I want to know whether the number 3 represents batch size? And why can't it changed to other numbers?

  1. It costs near 15 seconds to get the timestamp_embeddings of a 59s audio, which means audio input is audio = torch.ones((3, 32000 59))0.5, are there any methods to make it faster? It's a little bit slow. 3.The input of the recommanded code is a 15s audio, I want to know what is the longest audio that can be input to the model? Thank you very much!
kkoutini commented 2 years ago
  1. The model is trained on 10-seconds audio clips and has time positional encodings for 10 seconds only. If you want to do inference on longer clips, one possibility is using a sliding windows like the one here .

  2. Timestamp embbedings will cut the audio into small snippets and pass these sequentially to the model (see here ). A simple optimization is to stack the snippets and pass them as a batch to the GPU.

  3. The basic model can only deal with 10-seconds audio clips. This release contains models passt-s-f128-30sec-p16-s10-ap.473-swa.pt passt-s-f128-20sec-p16-s10-ap.474-swa.pt that can do inference on 20 and 30 seconds audio clips. These 2 model has time positional encodings 20 to 30 seconds. Although they are trained on 10-seconds audio clips. In order to make this possible, I sample a sub-sequence corresponding to 10 seconds of time positional encoding during training.

Junglesl commented 2 years ago
  1. The model is trained on 10-seconds audio clips and has time positional encodings for 10 seconds only. If you want to do inference on longer clips, one possibility is using a sliding windows like the one here .
  2. Timestamp embbedings will cut the audio into small snippets and pass these sequentially to the model (see here ). A simple optimization is to stack the snippets and pass them as a batch to the GPU.
  3. The basic model can only deal with 10-seconds audio clips. This release contains models passt-s-f128-30sec-p16-s10-ap.473-swa.pt passt-s-f128-20sec-p16-s10-ap.474-swa.pt that can do inference on 20 and 30 seconds audio clips. These 2 model has time positional encodings 20 to 30 seconds. Although they are trained on 10-seconds audio clips. In order to make this possible, I sample a sub-sequence corresponding to 10 seconds of time positional encoding during training.

Thank you for your reply very much! I have another question, could the model be loaded on multi-gpus? It costs about 2.86 seconds on a 10 seconds' audio to get its audio embedding,it's too slow since we have more than 400,000 audios. And I want to know if I cut the audio to 10 seconds audio segments,how can I integrate them together to get the final embedding? For example, if I have a 46 seconds audio,I cut them to 5 segments(Whether should I pad zero for this 46 seconds audio to 50 seconds?), for each segment,I obtain an 1295 dimension embedding,how can I obtain the final 1295 embedding for this 1295 dimension embedding? And I still have question on why the batch size must be 3,and why can't the batch size be 1? Looking forward to your reply.Thank you very much!

kkoutini commented 2 years ago

Hi, yes the model can be loaded on multiple-gpus and be used with DistributedDataParallel similar to other torch models.

And I want to know if I cut the audio to 10 seconds audio segments,how can I integrate them together to get the final embedding? For example, if I have a 46 seconds audio,I cut them to 5 segments(Whether should I pad zero for this 46 seconds audio to 50 seconds?), for each segment,I obtain an 1295 dimension embedding,how can I obtain the final 1295 embedding for this 1295 dimension embedding?

I didn't look much into the best way to aggregate local embedding. We tried the simple method of taking the global mean in HEAR, it worked well.

And I still have question on why the batch size must be 3,and why can't the batch size be 1?

There are no constraints on the batch size.

Junglesl commented 2 years ago

Hi, yes the model can be loaded on multiple-gpus and be used with DistributedDataParallel similar to other torch models.

And I want to know if I cut the audio to 10 seconds audio segments,how can I integrate them together to get the final embedding? For example, if I have a 46 seconds audio,I cut them to 5 segments(Whether should I pad zero for this 46 seconds audio to 50 seconds?), for each segment,I obtain an 1295 dimension embedding,how can I obtain the final 1295 embedding for this 1295 dimension embedding?

I didn't look much into the best way to aggregate local embedding. We tried the simple method of taking the global mean in HEAR, it worked well.

And I still have question on why the batch size must be 3,and why can't the batch size be 1?

There are no constraints on the batch size.

Thank you for your reply very much! There is another question,when I want to obtain the embeddings from the function get_timestamp_embeddings, Segmentation fault often happen. I don't know what happened and why. This is disturbed very much. Do you know the reason and how to solve it? I will be apperiate it very much!

kkoutini commented 2 years ago

Unfortunately I've never got a Segmentation fault. It can be caused by any of the dependencies or packages with native code, in the environment.

Junglesl commented 2 years ago

Unfortunately I've never got a Segmentation fault. It can be caused by any of the dependencies or packages with native code, in the environment.

I want to know if I only want to do inferfence use the pretained model,If I only need to install the packages in the green line? Do I need to install the packages in the red lines? I only install the passt_hear21-0.0.8 but I force the following bug:

微信图片_20220521120452 微信图片_20220521120459

I don't konw why?Could you give some suggestions? Thank you very much!

Junglesl commented 2 years ago

Unfortunately I've never got a Segmentation fault. It can be caused by any of the dependencies or packages with native code, in the environment.

And when I download the hear21passt manually and run:python setup.py install,I enforce the following bug:

微信图片_20220521132812

Why torch-11 is installed? I run the command following

微信图片_20220521132341

should't torch=1.8 is installed? It's really disturbing since I have expended much time on the environment settings and I don't know where the problem is.Hope you suggestions.Thank you very much!

Junglesl commented 2 years ago

Unfortunately I've never got a Segmentation fault. It can be caused by any of the dependencies or packages with native code, in the environment.

I find in environment.yml that conda-forge channel is above the defaults.

微信图片_20220523101206

Which is different from the common environment. If I don't put the conda-forge above the defaults, some bugs may arise? And the cuda and torchaudio can't use? Thank you!

kkoutini commented 2 years ago

Hi, the environment.yml is a snapshot of the environment I'm using. It was exported using:

conda env export --no-builds | grep -v "prefix" > environment.yml

I'm not sure why you have torch 1.11 installed and if it matters. I think the segment fault can happen in case of a problem in the complied dependencies. Maybe you can try to uninstall it first, then install the correct version:

pip3 install torch==1.8.1+cu111  torchaudio==0.8.1 -f https://download.pytorch.org/whl/lts/1.8/torch_lts.html

If it helps this the full environment I have, on another machine:

(ba3l) ➜  ~ conda list         
# packages in environment at /system/user/koutini/miniconda3/envs/ba3l:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                      1_llvm    conda-forge
_pytorch_select           0.1                       cpu_0  
absl-py                   0.12.0                   pypi_0    pypi
aiohttp                   3.7.4.post0              pypi_0    pypi
appdirs                   1.4.4              pyh9f0ad1d_0    conda-forge
astunparse                1.6.3              pyhd8ed1ab_0    conda-forge
async-timeout             3.0.1                    pypi_0    pypi
attrs                     20.3.0                   pypi_0    pypi
audioread                 2.1.9            py37h89c1867_0    conda-forge
av                        8.0.3                    pypi_0    pypi
ba3l                      0.0.0.1                   dev_0    <develop>
blas                      1.0                    openblas    conda-forge
brotlipy                  0.7.0           py37h5e8e339_1001    conda-forge
bzip2                     1.0.8                h7f98852_4    conda-forge
c-ares                    1.17.1               h7f98852_1    conda-forge
ca-certificates           2021.5.30            ha878542_0    conda-forge
cached-property           1.5.2                hd8ed1ab_1    conda-forge
cached_property           1.5.2              pyha770c72_1    conda-forge
cachetools                4.2.1                    pypi_0    pypi
certifi                   2021.5.30        py37h89c1867_0    conda-forge
cffi                      1.14.5           py37hc58025e_0    conda-forge
chardet                   4.0.0            py37h89c1867_1    conda-forge
cmake                     3.20.3               h8897547_0    conda-forge
colorama                  0.4.4              pyh9f0ad1d_0    conda-forge
cryptography              3.4.6            py37h5d9358c_0    conda-forge
cudatoolkit               11.2.0               h73cb219_8    conda-forge
cycler                    0.10.0                     py_2    conda-forge
dataclasses               0.8                pyhc8e2a94_1    conda-forge
decorator                 4.4.2                      py_0    conda-forge
docopt                    0.6.2                      py_1    conda-forge
einops                    0.3.0                    pypi_0    pypi
expat                     2.4.1                h9c3ff4c_0    conda-forge
ffmpeg                    4.3.1                hca11adc_2    conda-forge
freetype                  2.10.4               h0708190_1    conda-forge
fsspec                    0.8.7                    pypi_0    pypi
future                    0.18.2           py37h89c1867_3    conda-forge
gettext                   0.19.8.1          h0b5b191_1005    conda-forge
gitdb                     4.0.5              pyhd8ed1ab_1    conda-forge
gitpython                 3.1.14             pyhd8ed1ab_0    conda-forge
gmp                       6.2.1                h58526e2_0    conda-forge
gnutls                    3.6.13               h85f3911_1    conda-forge
google-auth               1.28.0                   pypi_0    pypi
google-auth-oauthlib      0.4.3                    pypi_0    pypi
gpuinfo                   1.0.0a7                  pypi_0    pypi
grpcio                    1.36.1                   pypi_0    pypi
h5py                      3.1.0           nompi_py37h1e651dc_100    conda-forge
hdf5                      1.10.6          nompi_h6a2412b_1114    conda-forge
idna                      2.10               pyh9f0ad1d_0    conda-forge
imageio                   2.9.0                    pypi_0    pypi
importlib-metadata        3.7.3            py37h89c1867_0    conda-forge
importlib_metadata        3.7.3                hd8ed1ab_0    conda-forge
intel-openmp              2020.2                      254  
jbig                      2.1               h7f98852_2003    conda-forge
joblib                    1.0.1              pyhd8ed1ab_0    conda-forge
jpeg                      9d                   h36c2ea0_0    conda-forge
jsonpickle                1.4.1              pyh9f0ad1d_0    conda-forge
kiwisolver                1.3.1            py37h2527ec5_1    conda-forge
krb5                      1.19.1               hcc1bbae_0    conda-forge
lame                      3.100             h7f98852_1001    conda-forge
lcms2                     2.12                 hddcbb42_0    conda-forge
ld_impl_linux-64          2.35.1               hea4e1c9_2    conda-forge
lerc                      2.2.1                h9c3ff4c_0    conda-forge
libblas                   3.9.0                8_openblas    conda-forge
libcblas                  3.9.0                8_openblas    conda-forge
libcurl                   7.77.0               h2574ce0_0    conda-forge
libdeflate                1.7                  h7f98852_5    conda-forge
libedit                   3.1.20191231         he28a2e2_2    conda-forge
libev                     4.33                 h516909a_1    conda-forge
libffi                    3.3                  h58526e2_2    conda-forge
libflac                   1.3.3                h9c3ff4c_1    conda-forge
libgcc-ng                 9.3.0               h2828fa1_19    conda-forge
libgfortran-ng            9.3.0               hff62375_19    conda-forge
libgfortran5              9.3.0               hff62375_19    conda-forge
libgomp                   9.3.0               h2828fa1_19    conda-forge
liblapack                 3.9.0                8_openblas    conda-forge
libllvm10                 10.0.1               he513fc3_3    conda-forge
libnghttp2                1.43.0               h812cca2_0    conda-forge
libogg                    1.3.4                h7f98852_1    conda-forge
libopenblas               0.3.12          pthreads_h4812303_1    conda-forge
libopus                   1.3.1                h7f98852_1    conda-forge
libpng                    1.6.37               h21135ba_2    conda-forge
librosa                   0.8.0              pyh9f0ad1d_0    conda-forge
libsndfile                1.0.31               h9c3ff4c_1    conda-forge
libssh2                   1.9.0                ha56f1ee_6    conda-forge
libstdcxx-ng              9.3.0               h6de172a_19    conda-forge
libtiff                   4.3.0                hf544144_1    conda-forge
libuv                     1.41.0               h7f98852_0    conda-forge
libvorbis                 1.3.7                h9c3ff4c_0    conda-forge
libwebp-base              1.2.0                h7f98852_2    conda-forge
llvm-openmp               11.1.0               h4bd325d_1    conda-forge
llvmlite                  0.36.0           py37h9d7f4d0_0    conda-forge
lz4-c                     1.9.3                h9c3ff4c_0    conda-forge
magma-cuda112             2.5.2                         1    pytorch
markdown                  3.3.4                    pypi_0    pypi
matplotlib-base           3.3.4            py37h0c9df89_0    conda-forge
mkl                       2020.2             ha770c72_256    conda-forge
mkl-include               2021.2.0           h726a3e6_389    conda-forge
mkl-service               2.3.0            py37h8f50634_2    conda-forge
multidict                 5.1.0                    pypi_0    pypi
munch                     2.5.0                      py_0    conda-forge
ncurses                   6.2                  h58526e2_4    conda-forge
nettle                    3.6                  he412f7d_0    conda-forge
ninja                     1.10.2               h4bd325d_0    conda-forge
numba                     0.53.0           py37h7dd73a4_1    conda-forge
numpy                     1.20.1           py37haa41c4c_0    conda-forge
oauthlib                  3.1.0                    pypi_0    pypi
olefile                   0.46               pyh9f0ad1d_1    conda-forge
openblas                  0.3.12          pthreads_h04b7a96_1    conda-forge
openh264                  2.1.1                h780b84a_0    conda-forge
openjpeg                  2.4.0                hb52868f_1    conda-forge
openssl                   1.1.1k               h7f98852_0    conda-forge
packaging                 20.9               pyh44b312d_0    conda-forge
pandas                    1.2.3            py37hdc94413_0    conda-forge
pillow                    8.1.2            py37h4600e1f_1    conda-forge
pip                       21.0.1             pyhd8ed1ab_0    conda-forge
pooch                     1.3.0              pyhd8ed1ab_0    conda-forge
protobuf                  3.15.6                   pypi_0    pypi
py-cpuinfo                7.0.0              pyh9f0ad1d_0    conda-forge
pyasn1                    0.4.8                    pypi_0    pypi
pyasn1-modules            0.2.8                    pypi_0    pypi
pycparser                 2.20               pyh9f0ad1d_2    conda-forge
pymongo                   3.11.3                   pypi_0    pypi
pyopenssl                 20.0.1             pyhd8ed1ab_0    conda-forge
pyparsing                 2.4.7              pyh9f0ad1d_0    conda-forge
pysocks                   1.7.1            py37h89c1867_3    conda-forge
pysoundfile               0.10.3.post1       pyhd3deb0d_0    conda-forge
python                    3.7.10          hffdb5ce_100_cpython    conda-forge
python-dateutil           2.8.1                      py_0    conda-forge
python_abi                3.7                     1_cp37m    conda-forge
pytorch-lightning         1.3.0.dev0                dev_0    <develop>
pytz                      2021.1             pyhd8ed1ab_0    conda-forge
pyyaml                    5.3.1                    pypi_0    pypi
readline                  8.0                  he28a2e2_2    conda-forge
requests                  2.25.1             pyhd3deb0d_0    conda-forge
requests-oauthlib         1.3.0                    pypi_0    pypi
resampy                   0.2.2                      py_0    conda-forge
rhash                     1.4.1                h7f98852_0    conda-forge
rsa                       4.7.2                    pypi_0    pypi
sacred                    0.8.1                     dev_0    <develop>
scikit-learn              0.24.1           py37h69acf81_0    conda-forge
scipy                     1.6.1            py37h14a347d_0    conda-forge
setuptools                49.6.0           py37h89c1867_3    conda-forge
six                       1.15.0             pyh9f0ad1d_0    conda-forge
smmap                     3.0.5              pyh44b312d_0    conda-forge
sqlite                    3.34.0               h74cdb3f_0    conda-forge
tensorboard               2.4.1                    pypi_0    pypi
tensorboard-plugin-wit    1.8.0                    pypi_0    pypi
test-tube                 0.7.5                    pypi_0    pypi
threadpoolctl             2.1.0              pyh5ca1d4c_0    conda-forge
timm                      0.4.12                   pypi_0    pypi
tk                        8.6.10               h21135ba_1    conda-forge
torch                     1.10.0a0+gitc51abf8          pypi_0    pypi
torchaudio                0.8.2                    pypi_0    pypi
torchmetrics              0.2.0                    pypi_0    pypi
torchvision               0.9.2+cu111              pypi_0    pypi
tornado                   6.1              py37h5e8e339_1    conda-forge
tqdm                      4.59.0                   pypi_0    pypi
typing_extensions         3.7.4.3                    py_0    conda-forge
urllib3                   1.26.4             pyhd8ed1ab_0    conda-forge
werkzeug                  1.0.1                    pypi_0    pypi
wheel                     0.36.2                   pypi_0    pypi
wrapt                     1.12.1           py37h5e8e339_3    conda-forge
x264                      1!161.3030           h7f98852_0    conda-forge
xz                        5.2.5                h516909a_1    conda-forge
yaml                      0.2.5                h516909a_0    conda-forge
yarl                      1.6.3                    pypi_0    pypi
zipp                      3.4.1              pyhd8ed1ab_0    conda-forge
zlib                      1.2.11            h516909a_1010    conda-forge
zstd                      1.5.0                ha95c52a_0    conda-forge
Junglesl commented 2 years ago

Hi, the environment.yml is a snapshot of the environment I'm using. It was exported using:

conda env export --no-builds | grep -v "prefix" > environment.yml

I'm not sure why you have torch 1.11 installed and if it matters. I think the segment fault can happen in case of a problem in the complied dependencies. Maybe you can try to uninstall it first, then install the correct version:

pip3 install torch==1.8.1+cu111  torchaudio==0.8.1 -f https://download.pytorch.org/whl/lts/1.8/torch_lts.html

If it helps this the full environment I have, on another machine:

(ba3l) ➜  ~ conda list         
# packages in environment at /system/user/koutini/miniconda3/envs/ba3l:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                      1_llvm    conda-forge
_pytorch_select           0.1                       cpu_0  
absl-py                   0.12.0                   pypi_0    pypi
aiohttp                   3.7.4.post0              pypi_0    pypi
appdirs                   1.4.4              pyh9f0ad1d_0    conda-forge
astunparse                1.6.3              pyhd8ed1ab_0    conda-forge
async-timeout             3.0.1                    pypi_0    pypi
attrs                     20.3.0                   pypi_0    pypi
audioread                 2.1.9            py37h89c1867_0    conda-forge
av                        8.0.3                    pypi_0    pypi
ba3l                      0.0.0.1                   dev_0    <develop>
blas                      1.0                    openblas    conda-forge
brotlipy                  0.7.0           py37h5e8e339_1001    conda-forge
bzip2                     1.0.8                h7f98852_4    conda-forge
c-ares                    1.17.1               h7f98852_1    conda-forge
ca-certificates           2021.5.30            ha878542_0    conda-forge
cached-property           1.5.2                hd8ed1ab_1    conda-forge
cached_property           1.5.2              pyha770c72_1    conda-forge
cachetools                4.2.1                    pypi_0    pypi
certifi                   2021.5.30        py37h89c1867_0    conda-forge
cffi                      1.14.5           py37hc58025e_0    conda-forge
chardet                   4.0.0            py37h89c1867_1    conda-forge
cmake                     3.20.3               h8897547_0    conda-forge
colorama                  0.4.4              pyh9f0ad1d_0    conda-forge
cryptography              3.4.6            py37h5d9358c_0    conda-forge
cudatoolkit               11.2.0               h73cb219_8    conda-forge
cycler                    0.10.0                     py_2    conda-forge
dataclasses               0.8                pyhc8e2a94_1    conda-forge
decorator                 4.4.2                      py_0    conda-forge
docopt                    0.6.2                      py_1    conda-forge
einops                    0.3.0                    pypi_0    pypi
expat                     2.4.1                h9c3ff4c_0    conda-forge
ffmpeg                    4.3.1                hca11adc_2    conda-forge
freetype                  2.10.4               h0708190_1    conda-forge
fsspec                    0.8.7                    pypi_0    pypi
future                    0.18.2           py37h89c1867_3    conda-forge
gettext                   0.19.8.1          h0b5b191_1005    conda-forge
gitdb                     4.0.5              pyhd8ed1ab_1    conda-forge
gitpython                 3.1.14             pyhd8ed1ab_0    conda-forge
gmp                       6.2.1                h58526e2_0    conda-forge
gnutls                    3.6.13               h85f3911_1    conda-forge
google-auth               1.28.0                   pypi_0    pypi
google-auth-oauthlib      0.4.3                    pypi_0    pypi
gpuinfo                   1.0.0a7                  pypi_0    pypi
grpcio                    1.36.1                   pypi_0    pypi
h5py                      3.1.0           nompi_py37h1e651dc_100    conda-forge
hdf5                      1.10.6          nompi_h6a2412b_1114    conda-forge
idna                      2.10               pyh9f0ad1d_0    conda-forge
imageio                   2.9.0                    pypi_0    pypi
importlib-metadata        3.7.3            py37h89c1867_0    conda-forge
importlib_metadata        3.7.3                hd8ed1ab_0    conda-forge
intel-openmp              2020.2                      254  
jbig                      2.1               h7f98852_2003    conda-forge
joblib                    1.0.1              pyhd8ed1ab_0    conda-forge
jpeg                      9d                   h36c2ea0_0    conda-forge
jsonpickle                1.4.1              pyh9f0ad1d_0    conda-forge
kiwisolver                1.3.1            py37h2527ec5_1    conda-forge
krb5                      1.19.1               hcc1bbae_0    conda-forge
lame                      3.100             h7f98852_1001    conda-forge
lcms2                     2.12                 hddcbb42_0    conda-forge
ld_impl_linux-64          2.35.1               hea4e1c9_2    conda-forge
lerc                      2.2.1                h9c3ff4c_0    conda-forge
libblas                   3.9.0                8_openblas    conda-forge
libcblas                  3.9.0                8_openblas    conda-forge
libcurl                   7.77.0               h2574ce0_0    conda-forge
libdeflate                1.7                  h7f98852_5    conda-forge
libedit                   3.1.20191231         he28a2e2_2    conda-forge
libev                     4.33                 h516909a_1    conda-forge
libffi                    3.3                  h58526e2_2    conda-forge
libflac                   1.3.3                h9c3ff4c_1    conda-forge
libgcc-ng                 9.3.0               h2828fa1_19    conda-forge
libgfortran-ng            9.3.0               hff62375_19    conda-forge
libgfortran5              9.3.0               hff62375_19    conda-forge
libgomp                   9.3.0               h2828fa1_19    conda-forge
liblapack                 3.9.0                8_openblas    conda-forge
libllvm10                 10.0.1               he513fc3_3    conda-forge
libnghttp2                1.43.0               h812cca2_0    conda-forge
libogg                    1.3.4                h7f98852_1    conda-forge
libopenblas               0.3.12          pthreads_h4812303_1    conda-forge
libopus                   1.3.1                h7f98852_1    conda-forge
libpng                    1.6.37               h21135ba_2    conda-forge
librosa                   0.8.0              pyh9f0ad1d_0    conda-forge
libsndfile                1.0.31               h9c3ff4c_1    conda-forge
libssh2                   1.9.0                ha56f1ee_6    conda-forge
libstdcxx-ng              9.3.0               h6de172a_19    conda-forge
libtiff                   4.3.0                hf544144_1    conda-forge
libuv                     1.41.0               h7f98852_0    conda-forge
libvorbis                 1.3.7                h9c3ff4c_0    conda-forge
libwebp-base              1.2.0                h7f98852_2    conda-forge
llvm-openmp               11.1.0               h4bd325d_1    conda-forge
llvmlite                  0.36.0           py37h9d7f4d0_0    conda-forge
lz4-c                     1.9.3                h9c3ff4c_0    conda-forge
magma-cuda112             2.5.2                         1    pytorch
markdown                  3.3.4                    pypi_0    pypi
matplotlib-base           3.3.4            py37h0c9df89_0    conda-forge
mkl                       2020.2             ha770c72_256    conda-forge
mkl-include               2021.2.0           h726a3e6_389    conda-forge
mkl-service               2.3.0            py37h8f50634_2    conda-forge
multidict                 5.1.0                    pypi_0    pypi
munch                     2.5.0                      py_0    conda-forge
ncurses                   6.2                  h58526e2_4    conda-forge
nettle                    3.6                  he412f7d_0    conda-forge
ninja                     1.10.2               h4bd325d_0    conda-forge
numba                     0.53.0           py37h7dd73a4_1    conda-forge
numpy                     1.20.1           py37haa41c4c_0    conda-forge
oauthlib                  3.1.0                    pypi_0    pypi
olefile                   0.46               pyh9f0ad1d_1    conda-forge
openblas                  0.3.12          pthreads_h04b7a96_1    conda-forge
openh264                  2.1.1                h780b84a_0    conda-forge
openjpeg                  2.4.0                hb52868f_1    conda-forge
openssl                   1.1.1k               h7f98852_0    conda-forge
packaging                 20.9               pyh44b312d_0    conda-forge
pandas                    1.2.3            py37hdc94413_0    conda-forge
pillow                    8.1.2            py37h4600e1f_1    conda-forge
pip                       21.0.1             pyhd8ed1ab_0    conda-forge
pooch                     1.3.0              pyhd8ed1ab_0    conda-forge
protobuf                  3.15.6                   pypi_0    pypi
py-cpuinfo                7.0.0              pyh9f0ad1d_0    conda-forge
pyasn1                    0.4.8                    pypi_0    pypi
pyasn1-modules            0.2.8                    pypi_0    pypi
pycparser                 2.20               pyh9f0ad1d_2    conda-forge
pymongo                   3.11.3                   pypi_0    pypi
pyopenssl                 20.0.1             pyhd8ed1ab_0    conda-forge
pyparsing                 2.4.7              pyh9f0ad1d_0    conda-forge
pysocks                   1.7.1            py37h89c1867_3    conda-forge
pysoundfile               0.10.3.post1       pyhd3deb0d_0    conda-forge
python                    3.7.10          hffdb5ce_100_cpython    conda-forge
python-dateutil           2.8.1                      py_0    conda-forge
python_abi                3.7                     1_cp37m    conda-forge
pytorch-lightning         1.3.0.dev0                dev_0    <develop>
pytz                      2021.1             pyhd8ed1ab_0    conda-forge
pyyaml                    5.3.1                    pypi_0    pypi
readline                  8.0                  he28a2e2_2    conda-forge
requests                  2.25.1             pyhd3deb0d_0    conda-forge
requests-oauthlib         1.3.0                    pypi_0    pypi
resampy                   0.2.2                      py_0    conda-forge
rhash                     1.4.1                h7f98852_0    conda-forge
rsa                       4.7.2                    pypi_0    pypi
sacred                    0.8.1                     dev_0    <develop>
scikit-learn              0.24.1           py37h69acf81_0    conda-forge
scipy                     1.6.1            py37h14a347d_0    conda-forge
setuptools                49.6.0           py37h89c1867_3    conda-forge
six                       1.15.0             pyh9f0ad1d_0    conda-forge
smmap                     3.0.5              pyh44b312d_0    conda-forge
sqlite                    3.34.0               h74cdb3f_0    conda-forge
tensorboard               2.4.1                    pypi_0    pypi
tensorboard-plugin-wit    1.8.0                    pypi_0    pypi
test-tube                 0.7.5                    pypi_0    pypi
threadpoolctl             2.1.0              pyh5ca1d4c_0    conda-forge
timm                      0.4.12                   pypi_0    pypi
tk                        8.6.10               h21135ba_1    conda-forge
torch                     1.10.0a0+gitc51abf8          pypi_0    pypi
torchaudio                0.8.2                    pypi_0    pypi
torchmetrics              0.2.0                    pypi_0    pypi
torchvision               0.9.2+cu111              pypi_0    pypi
tornado                   6.1              py37h5e8e339_1    conda-forge
tqdm                      4.59.0                   pypi_0    pypi
typing_extensions         3.7.4.3                    py_0    conda-forge
urllib3                   1.26.4             pyhd8ed1ab_0    conda-forge
werkzeug                  1.0.1                    pypi_0    pypi
wheel                     0.36.2                   pypi_0    pypi
wrapt                     1.12.1           py37h5e8e339_3    conda-forge
x264                      1!161.3030           h7f98852_0    conda-forge
xz                        5.2.5                h516909a_1    conda-forge
yaml                      0.2.5                h516909a_0    conda-forge
yarl                      1.6.3                    pypi_0    pypi
zipp                      3.4.1              pyhd8ed1ab_0    conda-forge
zlib                      1.2.11            h516909a_1010    conda-forge
zstd                      1.5.0                ha95c52a_0    conda-forge

Thank you for your reply. I uninstall all the environment before and install them as you suggest,now I can run the code successfully. Thank you very much!