Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Torch 1.10 #14169

Merged
merged 4 commits into from
Oct 29, 2021
Merged

Torch 1.10 #14169

merged 4 commits into from
Oct 29, 2021

Conversation

LysandreJik
Copy link
Member

Authorize torch 1.10

@JohnnyC08
Copy link
Contributor

As a side note. I'm excited that label smoothing is now integrated into cross entropy! https://pytorch.org/docs/stable/generated/torch.nn.CrossEntropyLoss.html

Excited to replace my current implementation with this.

@LysandreJik
Copy link
Member Author

@anton-l @patrickvonplaten @Narsil there's the following error when passing to torch 1.10:

udioClassificationPipelineTests.test_small_model_pt _____________
[gw0] linux -- Python 3.7.12 /usr/local/bin/python

self = <tests.test_pipelines_audio_classification.AudioClassificationPipelineTests testMethod=test_small_model_pt>

    @require_torch
    def test_small_model_pt(self):
        model = "anton-l/wav2vec2-random-tiny-classifier"
    
        audio_classifier = pipeline("audio-classification", model=model)
    
        audio = np.ones((8000,))
        output = audio_classifier(audio, top_k=4)
        self.assertEqual(
            nested_simplify(output, decimals=4),
            [
                {"score": 0.0843, "label": "on"},
                {"score": 0.0840, "label": "left"},
                {"score": 0.0837, "label": "off"},
>               {"score": 0.0835, "label": "yes"},
            ],
        )
E       AssertionError: Lists differ: [{'score': 0.0842, 'label': 'no'}, {'score': 0.0838, 'lab[77 chars]ht'}] != [{'score': 0.0843, 'label': 'on'}, {'score': 0.084, 'labe[77 chars]es'}]
E       
E       First differing element 0:
E       {'score': 0.0842, 'label': 'no'}
E       {'score': 0.0843, 'label': 'on'}
E       
E       - [{'label': 'no', 'score': 0.0842},
E       ?              -                 ^
E       
E       + [{'label': 'on', 'score': 0.0843},
E       ?             +                  ^
E       
E       -  {'label': 'up', 'score': 0.0838},
E       ?             ^^                ^^
E       
E       +  {'label': 'left', 'score': 0.084},
E       ?             ^^^^                ^
E       
E       -  {'label': 'go', 'score': 0.0837},
E       ?             -
E       
E       +  {'label': 'off', 'score': 0.0837},
E       ?              ++
E       
E       -  {'label': 'right', 'score': 0.0834}]
E       ?             ^^^^^                 ^
E       
E       +  {'label': 'yes', 'score': 0.0835}]

Do you know where it might come from?

@anton-l
Copy link
Member

anton-l commented Oct 28, 2021

@LysandreJik I can't track down which commit made the outputs different yet. The checkpoint certainly didn't change. Is it only torch 1.10 that gets affected?

@LysandreJik
Copy link
Member Author

It seems so!

Copy link
Collaborator

@sgugger sgugger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for all of your work on this upgrade!

@LysandreJik LysandreJik merged commit 63d91f4 into master Oct 29, 2021
@LysandreJik LysandreJik deleted the torch-1.10 branch October 29, 2021 17:43
LysandreJik added a commit that referenced this pull request Oct 29, 2021
* Torch 1.10

* torch scatter for 1.10

* style

* Skip tests
ok
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants