Detail:
[1972:MainThread](2024-05-11 12:05:43,533) ERROR - qlib.workflow - [utils.py:41] - An exception has been raised[AttributeError: Please run qlib.init() first using qlib].
File "learn_zhushi.py", line 490, in
main(args) # 调用主函数进行训练与评估
File "learn_zhushi.py", line 272, in main
train_loader, valid_loader, test_loader = create_loaders(args) # 创建数据加载器
File "learn_zhushi.py", line 196, in create_loaders
dataset = DatasetH(hanlder, segments) # 创建数据集
File "/root/miniconda3/envs/AIQI/lib/python3.7/site-packages/qlib/qlib/data/dataset/init.py", line 119, in init
self.handler: DataHandler = init_instance_by_config(handler, accept_types=DataHandler)
File "/root/miniconda3/envs/AIQI/lib/python3.7/site-packages/qlib/qlib/utils/mod.py", line 174, in init_instance_by_config
return klass(cls_kwargs, try_kwargs, kwargs)
File "/root/miniconda3/envs/AIQI/lib/python3.7/site-packages/qlib/contrib/data/handler.py", line 85, in initkwargs
File "/root/miniconda3/envs/AIQI/lib/python3.7/site-packages/qlib/data/dataset/handler.py", line 468, in init
super().init(instruments, start_time, end_time, data_loader, kwargs)
File "/root/miniconda3/envs/AIQI/lib/python3.7/site-packages/qlib/data/dataset/handler.py", line 100, in init
self.setup_data()
File "/root/miniconda3/envs/AIQI/lib/python3.7/site-packages/qlib/data/dataset/handler.py", line 610, in setup_data
super().setup_data(kwargs)
File "/root/miniconda3/envs/AIQI/lib/python3.7/site-packages/qlib/data/dataset/handler.py", line 144, in setup_data
self._data = lazy_sort_index(self.data_loader.load(self.instruments, self.start_time, self.end_time))
File "/root/miniconda3/envs/AIQI/lib/python3.7/site-packages/qlib/data/dataset/loader.py", line 137, in load
for grp, (exprs, names) in self.fields.items()
File "/root/miniconda3/envs/AIQI/lib/python3.7/site-packages/qlib/data/dataset/loader.py", line 137, in
for grp, (exprs, names) in self.fields.items()
File "/root/miniconda3/envs/AIQI/lib/python3.7/site-packages/qlib/data/dataset/loader.py", line 209, in load_group_df
instruments = D.instruments(instruments, filter_pipe=self.filter_pipe)
File "/root/miniconda3/envs/AIQI/lib/python3.7/site-packages/qlib/utils/init.py", line 812, in getattr
raise AttributeError("Please run qlib.init() first using qlib")
AttributeError: Please run qlib.init() first using qlib
Detail: [1972:MainThread](2024-05-11 12:05:43,533) ERROR - qlib.workflow - [utils.py:41] - An exception has been raised[AttributeError: Please run qlib.init() first using qlib]. File "learn_zhushi.py", line 490, in
main(args) # 调用主函数进行训练与评估
File "learn_zhushi.py", line 272, in main
train_loader, valid_loader, test_loader = create_loaders(args) # 创建数据加载器
File "learn_zhushi.py", line 196, in create_loaders
dataset = DatasetH(hanlder, segments) # 创建数据集
File "/root/miniconda3/envs/AIQI/lib/python3.7/site-packages/qlib/qlib/data/dataset/init.py", line 119, in init
self.handler: DataHandler = init_instance_by_config(handler, accept_types=DataHandler)
File "/root/miniconda3/envs/AIQI/lib/python3.7/site-packages/qlib/qlib/utils/mod.py", line 174, in init_instance_by_config
return klass(cls_kwargs, try_kwargs, kwargs)
File "/root/miniconda3/envs/AIQI/lib/python3.7/site-packages/qlib/contrib/data/handler.py", line 85, in init
kwargs
File "/root/miniconda3/envs/AIQI/lib/python3.7/site-packages/qlib/data/dataset/handler.py", line 468, in init
super().init(instruments, start_time, end_time, data_loader, kwargs)
File "/root/miniconda3/envs/AIQI/lib/python3.7/site-packages/qlib/data/dataset/handler.py", line 100, in init
self.setup_data()
File "/root/miniconda3/envs/AIQI/lib/python3.7/site-packages/qlib/data/dataset/handler.py", line 610, in setup_data
super().setup_data(kwargs)
File "/root/miniconda3/envs/AIQI/lib/python3.7/site-packages/qlib/data/dataset/handler.py", line 144, in setup_data
self._data = lazy_sort_index(self.data_loader.load(self.instruments, self.start_time, self.end_time))
File "/root/miniconda3/envs/AIQI/lib/python3.7/site-packages/qlib/data/dataset/loader.py", line 137, in load
for grp, (exprs, names) in self.fields.items()
File "/root/miniconda3/envs/AIQI/lib/python3.7/site-packages/qlib/data/dataset/loader.py", line 137, in
for grp, (exprs, names) in self.fields.items()
File "/root/miniconda3/envs/AIQI/lib/python3.7/site-packages/qlib/data/dataset/loader.py", line 209, in load_group_df
instruments = D.instruments(instruments, filter_pipe=self.filter_pipe)
File "/root/miniconda3/envs/AIQI/lib/python3.7/site-packages/qlib/utils/init.py", line 812, in getattr
raise AttributeError("Please run qlib.init() first using qlib")
AttributeError: Please run qlib.init() first using qlib
Could you tell me how to solve this problem?Thx.