-
Notifications
You must be signed in to change notification settings - Fork 454
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
ModuleNotFoundError: No module named 'transformers.generation_utils' #316
Comments
老哥,请问你解决了吗? |
已解决,我本来安装的是transformers=4.41.2版本,将其版本改为4.27.1版本即可 |
谢谢!同样的问题解决了! |
Hello, I am facing the same issue. Is it resolved or did anyone find a solution? I tried with Python 3.10 and 3.9 and it still persists... |
This made it, thank you! |
Good luck!
From: "Hiyam ***@***.***>
Date: Sun, Sep 22, 2024, 23:13
Subject: [External] Re: [thunlp/OpenPrompt] ModuleNotFoundError: No module
named 'transformers.generation_utils' (Issue #316)
To: ***@***.***>
Cc: ***@***.***>, "Comment"<
***@***.***>
已解决,我本来安装的是transformers=4.41.2版本,将其版本改为4.27.1版本即可
This made it, thank you!
—
Reply to this email directly, view it on GitHub
<#316 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BKQ3K2OKPQNKARCS3ZOPJDTZX3NBBAVCNFSM6AAAAABLSNOYFSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNRWHAZTCMRUHE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Code:
import numpy as np
from sklearn.model_selection import KFold
#import tensorflow as tf
from sklearn import metrics
from sklearn.metrics import accuracy_score
from sklearn.metrics import f1_score
from sklearn.metrics import precision_score
from sklearn.metrics import recall_score
from torch.utils.data import Dataset, DataLoader,SubsetRandomSampler
from sklearn.metrics import precision_recall_fscore_support
from transformers import AdamW, get_linear_schedule_with_warmup
from openprompt import PromptDataLoader
from torch import nn
import os
error:
ModuleNotFoundError Traceback (most recent call last)
Cell In[10], line 14
12 from sklearn.metrics import precision_recall_fscore_support
13 from transformers import AdamW, get_linear_schedule_with_warmup
---> 14 from openprompt import PromptDataLoader
15 from torch import nn
16 import os
File ~/miniconda3/lib/python3.8/site-packages/openprompt/init.py:2
1 version = "1.0.1"
----> 2 from .pipeline_base import PromptDataLoader, PromptModel, PromptForClassification, PromptForGeneration
3 from .utils import *
4 from .prompt_base import Template, Verbalizer
File ~/miniconda3/lib/python3.8/site-packages/openprompt/pipeline_base.py:4
2 from torch.utils.data.sampler import RandomSampler
3 from transformers.configuration_utils import PretrainedConfig
----> 4 from transformers.generation_utils import GenerationMixin
5 import torch
6 import torch.nn as nn
ModuleNotFoundError: No module named 'transformers.generation_utils'
The text was updated successfully, but these errors were encountered: