You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "D:\major assignment\examples\single_model\run_cl4kt_demo.py", line 9, in
run_edustudio(
File "D:\major assignment\edustudio\quickstart\quickstart.py", line 72, in run_edustudio
raise e
File "D:\major assignment\edustudio\quickstart\quickstart.py", line 57, in run_edustudio
traintpl = cls(cfg)
File "D:\major assignment\edustudio\traintpl\gd_traintpl.py", line 25, in init
super().init(cfg)
File "D:\major assignment\edustudio\traintpl\base_traintpl.py", line 54, in init
self.datatpl = self.get_datatpl_obj()
File "D:\major assignment\edustudio\traintpl\base_traintpl.py", line 87, in get_datatpl_obj
datatpl: BaseDataTPL = self.datatpl_cls.from_cfg(self.cfg)
File "D:\major assignment\edustudio\datatpl\common\general_datatpl.py", line 107, in from_cfg
return cls(cfg, **kwargs)
File "D:\major assignment\edustudio\datatpl\common\edu_datatpl.py", line 30, in init
super().init(cfg, df, df_train, df_valid, df_test, status)
File "D:\major assignment\edustudio\datatpl\common\general_datatpl.py", line 78, in init
self.process_data()
File "D:\major assignment\edustudio\datatpl\common\general_datatpl.py", line 143, in process_data
self.process_load_data_from_middata()
File "D:\major assignment\edustudio\datatpl\common\general_datatpl.py", line 126, in process_load_data_from_middata
kwargs = op.process(**kwargs)
File "D:\major assignment\edustudio\atom_op\mid2cache\single\M2C_CL4KT_OP.py", line 25, in process
kwargs = self.compute_cpt2difflevel(**kwargs)
File "D:\major assignment\edustudio\atom_op\mid2cache\single\M2C_CL4KT_OP.py", line 65, in compute_cpt2difflevel
for i, (c_list, r_list) in enumerate(zip(kwargs['df_train_folds'][0]['cpt_unfold_seq:token_seq'], kwargs['df_train_folds'][0]['label_seq:float_seq'])):
KeyError: 'df_train_folds'
经调试发现,cl4kt的kwargs并没有'df_train_folds'键值对。通过比对其他KT模型的数据模板,我发现是因为原子操作M2C_CL4KT_OP缺少了对'df_train_folds'的赋值。继续探索发现,在其他模型的数据模板中,对'df_train_folds'的赋值由M2C_RandomDataSplit4KT原子操作完成。于是我参照M2C_RandomDataSplit4KT对M2C_CL4KT_OP进行了修改。运行后,该报错消失,但又产生了新的报错,如下:
Traceback (most recent call last):
File "D:\major assignment\examples\single_model\run_cl4kt_demo.py", line 9, in
run_edustudio(
File "D:\major assignment\edustudio\quickstart\quickstart.py", line 72, in run_edustudio
raise e
File "D:\major assignment\edustudio\quickstart\quickstart.py", line 58, in run_edustudio
traintpl.start()
File "D:\major assignment\edustudio\traintpl\gd_traintpl.py", line 70, in start
self.model.build_cfg()
File "D:\major assignment\edustudio\model\KT\cl4kt.py", line 55, in build_cfg
self.n_item = self.datatpl_cfg['dt_info']['exer_count']
KeyError: 'exer_count'
经对比发现,datatpl_cfg['dt_info']['exer_count']的赋值是由M2C_RandomDataSplit4K的set_dt_info完成,而M2C_CL4KT_OP确实缺失了这一步。因此我对照M2C_RandomDataSplit4K的set_dt_info对M2C_CL4KT_OP的set_dt_info进行了相应修改。再次测试,代码成功运行。
修改后的完整M2C_CL4KT_OP代码如下:
from ..KT import M2C_BuildSeqInterFeats
import torch
import pandas as pd
import numpy as np
from edustudio.datatpl.utils import PadSeqUtil
from collections import defaultdict
from edustudio.datatpl.utils import SpliterUtil
from itertools import chain
Traceback (most recent call last):
File "D:\major assignment\examples\single_model\run_cl4kt_demo.py", line 9, in
run_edustudio(
File "D:\major assignment\edustudio\quickstart\quickstart.py", line 72, in run_edustudio
raise e
File "D:\major assignment\edustudio\quickstart\quickstart.py", line 57, in run_edustudio
traintpl = cls(cfg)
File "D:\major assignment\edustudio\traintpl\gd_traintpl.py", line 25, in init
super().init(cfg)
File "D:\major assignment\edustudio\traintpl\base_traintpl.py", line 54, in init
self.datatpl = self.get_datatpl_obj()
File "D:\major assignment\edustudio\traintpl\base_traintpl.py", line 87, in get_datatpl_obj
datatpl: BaseDataTPL = self.datatpl_cls.from_cfg(self.cfg)
File "D:\major assignment\edustudio\datatpl\common\general_datatpl.py", line 107, in from_cfg
return cls(cfg, **kwargs)
File "D:\major assignment\edustudio\datatpl\common\edu_datatpl.py", line 30, in init
super().init(cfg, df, df_train, df_valid, df_test, status)
File "D:\major assignment\edustudio\datatpl\common\general_datatpl.py", line 78, in init
self.process_data()
File "D:\major assignment\edustudio\datatpl\common\general_datatpl.py", line 143, in process_data
self.process_load_data_from_middata()
File "D:\major assignment\edustudio\datatpl\common\general_datatpl.py", line 126, in process_load_data_from_middata
kwargs = op.process(**kwargs)
File "D:\major assignment\edustudio\atom_op\mid2cache\single\M2C_CL4KT_OP.py", line 25, in process
kwargs = self.compute_cpt2difflevel(**kwargs)
File "D:\major assignment\edustudio\atom_op\mid2cache\single\M2C_CL4KT_OP.py", line 65, in compute_cpt2difflevel
for i, (c_list, r_list) in enumerate(zip(kwargs['df_train_folds'][0]['cpt_unfold_seq:token_seq'], kwargs['df_train_folds'][0]['label_seq:float_seq'])):
KeyError: 'df_train_folds'
经调试发现,cl4kt的kwargs并没有'df_train_folds'键值对。通过比对其他KT模型的数据模板,我发现是因为原子操作M2C_CL4KT_OP缺少了对'df_train_folds'的赋值。继续探索发现,在其他模型的数据模板中,对'df_train_folds'的赋值由M2C_RandomDataSplit4KT原子操作完成。于是我参照M2C_RandomDataSplit4KT对M2C_CL4KT_OP进行了修改。运行后,该报错消失,但又产生了新的报错,如下:
Traceback (most recent call last):
File "D:\major assignment\examples\single_model\run_cl4kt_demo.py", line 9, in
run_edustudio(
File "D:\major assignment\edustudio\quickstart\quickstart.py", line 72, in run_edustudio
raise e
File "D:\major assignment\edustudio\quickstart\quickstart.py", line 58, in run_edustudio
traintpl.start()
File "D:\major assignment\edustudio\traintpl\gd_traintpl.py", line 70, in start
self.model.build_cfg()
File "D:\major assignment\edustudio\model\KT\cl4kt.py", line 55, in build_cfg
self.n_item = self.datatpl_cfg['dt_info']['exer_count']
KeyError: 'exer_count'
经对比发现,datatpl_cfg['dt_info']['exer_count']的赋值是由M2C_RandomDataSplit4K的set_dt_info完成,而M2C_CL4KT_OP确实缺失了这一步。因此我对照M2C_RandomDataSplit4K的set_dt_info对M2C_CL4KT_OP的set_dt_info进行了相应修改。再次测试,代码成功运行。
修改后的完整M2C_CL4KT_OP代码如下:
from ..KT import M2C_BuildSeqInterFeats
import torch
import pandas as pd
import numpy as np
from edustudio.datatpl.utils import PadSeqUtil
from collections import defaultdict
from edustudio.datatpl.utils import SpliterUtil
from itertools import chain
class M2C_CL4KT_OP(M2C_BuildSeqInterFeats):
default_cfg = {
'seed': 2023,
'divide_by': 'stu',
'window_size': 200,
"divide_scale_list": [7,1,2],
'sequence_truncation': '', # option: recent、history
The text was updated successfully, but these errors were encountered: