Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

After running 'nosetests -d', got 'TypeError: 'AudioMetaData' object is not subscriptable' in four tests #21

Open
lilytong20 opened this issue Sep 16, 2021 · 3 comments

Comments

@lilytong20
Copy link

Hi,

After installing the model in colab, I tried to run installation test as instructed. Then got the error message as shown in the attachment.

There were four tests reporting similar error, they were:

ERROR: testDataLoader (cpc.unit_tests.TestDataLoader)
ERROR: testLoadData (cpc.unit_tests.TestDataLoader)
ERROR: testPartialLoader (cpc.unit_tests.TestDataLoader)
ERROR: testSeqLabels (cpc.unit_tests.TestPhonemParser)

The TypeError were all 'TypeError: 'AudioMetaData' object is not subscriptable'.

Does anyone happen to know the reasons for this?

Thank you very much.

error message

@zhangzh16
Copy link

zhangzh16 commented Sep 23, 2021

Hi,

After installing the model in colab, I tried to run installation test as instructed. Then got the error message as shown in the attachment.

There were four tests reporting similar error, they were:

ERROR: testDataLoader (cpc.unit_tests.TestDataLoader)
ERROR: testLoadData (cpc.unit_tests.TestDataLoader)
ERROR: testPartialLoader (cpc.unit_tests.TestDataLoader)
ERROR: testSeqLabels (cpc.unit_tests.TestPhonemParser)

The TypeError were all 'TypeError: 'AudioMetaData' object is not subscriptable'.

Does anyone happen to know the reasons for this?

Thank you very much.

error message

I have the same problem with you. Have you found how to solve it? Thanks a lot!

@lilytong20
Copy link
Author

lilytong20 commented Sep 27, 2021 via email

@robinsrm
Copy link

robinsrm commented Oct 21, 2021

Hey, Torchaudio recently changed the output of torchaudio.info. An easy fix would be to change the extractLength in dataset.py with :

'

def extractLength(couple):
    speaker, locPath = couple
    try:
        info = torchaudio.info(str(locPath))[0]
        dur = info.length
    except:
        info = torchaudio.info(str(locPath))
        dur = info.num_frames
    return dur

`

seungwonpark added a commit to seungwonpark/CPC_audio that referenced this issue Nov 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants