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

RuntimeError: Error(s) in loading state_dict for APCEnsembler: #374

Open
Jai-Agarwal-04 opened this issue Dec 21, 2023 · 1 comment
Open

Comments

@Jai-Agarwal-04
Copy link

Using APC trainer on Politic dataset of PyAbsa datset
my code :

from pyabsa import download_all_available_datasets

download_all_available_datasets()

my_dataset = DatasetItem("/kaggle/working/integrated_datasets/datasets/apc_datasets/99.PoliticalData/custom.train.txt")

from pyabsa import ModelSaveOption, DeviceTypeOption
import warnings

warnings.filterwarnings("ignore")

from pyabsa import AspectPolarityClassification as APC
config = APC.APCConfigManager.get_apc_config_english()

from pyabsa import ModelSaveOption, DeviceTypeOption

config.num_epoch = 1
config.model = APC.APCModelList.FAST_LSA_T_V2
trainer = APC.APCTrainer(
config=config,
dataset=my_dataset,
from_checkpoint="english",
# if you want to resume training from our pretrained checkpoints, you can pass the checkpoint name here
auto_device=DeviceTypeOption.AUTO,
path_to_save=None, # set a path to save checkpoints, if it is None, save checkpoints at 'checkpoints' folder
checkpoint_save_mode=ModelSaveOption.SAVE_MODEL_STATE_DICT,
load_aug=False,
# there are some augmentation dataset for integrated datasets, you use them by setting load_aug=True to improve performance
)

and getting RuntimeError: Error(s) in loading state_dict for APCEnsembler:

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

No branches or pull requests

2 participants