Lei-Kun / End-to-end-DRL-for-FJSP

This is the official code of the publised paper 'A Multi-action Deep Reinforcement Learning Framework for Flexible Job-shop Scheduling Problem'
MIT License
248 stars 57 forks source link

问题请教 #12

Open ghost opened 1 year ago

ghost commented 1 year ago

非常抱歉在这个时刻打扰到你,很荣幸阅读你的论文,从中受到了很多启发。但是我在使用你的源码去实验的过程中遇见了一些问题,希望能请教一下你。在使用validation_realWorld.py时遇见了这样的问题,不知道该怎么样解决。 Traceback (most recent call last): File "D:\End-to-end-DRL-for-FJSP-main\FJSP_RealWorld\validation_realWorld.py", line 219, in a = test(filepath, data_file) File "D:\End-to-end-DRL-for-FJSP-main\FJSP_RealWorld\validation_realWorld.py", line 162, in test ppo.policy_job.load_state_dict(torch.load(job_path1)) File "D:\anaconda\envs\pytorch\lib\site-packages\torch\nn\modules\module.py", line 1482, in load_state_dict raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( RuntimeError: Error(s) in loading state_dict for Job_Actor: Unexpected key(s) in state_dict: "feature_extract.mlps.0.linears.0.weight", "feature_extract.mlps.0.linears.0.bias", "feature_extract.mlps.0.linears.1.weight", "feature_extract.mlps.0.linears.1.bias", "feature_extract.mlps.0.linears.2.weight", "feature_extract.mlps.0.linears.2.bias", "feature_extract.mlps.0.batch_norms.0.weight", "feature_extract.mlps.0.batch_norms.0.bias", "feature_extract.mlps.0.batch_norms.0.running_mean", "feature_extract.mlps.0.batch_norms.0.running_var", "feature_extract.mlps.0.batch_norms.0.num_batches_tracked", "feature_extract.mlps.0.batch_norms.1.weight", "feature_extract.mlps.0.batch_norms.1.bias", "feature_extract.mlps.0.batch_norms.1.running_mean", "feature_extract.mlps.0.batch_norms.1.running_var", "feature_extract.mlps.0.batch_norms.1.num_batches_tracked", "feature_extract.mlps.1.linears.0.weight", "feature_extract.mlps.1.linears.0.bias", "feature_extract.mlps.1.linears.1.weight", "feature_extract.mlps.1.linears.1.bias", "feature_extract.mlps.1.linears.2.weight", "feature_extract.mlps.1.linears.2.bias", "feature_extract.mlps.1.batch_norms.0.weight", "feature_extract.mlps.1.batch_norms.0.bias", "feature_extract.mlps.1.batch_norms.0.running_mean", "feature_extract.mlps.1.batch_norms.0.running_var", "feature_extract.mlps.1.batch_norms.0.num_batches_tracked", "feature_extract.mlps.1.batch_norms.1.weight", "feature_extract.mlps.1.batch_norms.1.bias", "feature_extract.mlps.1.batch_norms.1.running_mean", "feature_extract.mlps.1.batch_norms.1.running_var", "feature_extract.mlps.1.batch_norms.1.num_batches_tracked", "feature_extract.bn.weight", "feature_extract.bn.bias", "feature_extract.bn.running_mean", "feature_extract.bn.running_var", "feature_extract.bn.num_batches_tracked", "feature_extract.batch_norms.0.weight", "feature_extract.batch_norms.0.bias", "feature_extract.batch_norms.0.running_mean", "feature_extract.batch_norms.0.running_var", "feature_extract.batch_norms.0.num_batches_tracked", "feature_extract.batch_norms.1.weight", "feature_extract.batch_norms.1.bias", "feature_extract.batch_norms.1.running_mean", "feature_extract.batch_norms.1.running_var", "feature_extract.batch_norms.1.num_batches_tracked".

ghost commented 1 year ago

Traceback (most recent call last): File "D:\End-to-end-DRL-for-FJSP-main\FJSP_RealWorld\PPOwithValue.py", line 468, in main(100) File "D:\End-to-end-DRL-for-FJSP-main\FJSP_RealWorld\PPOwithValue.py", line 319, in main env = FJSP(configs.n_j, configs.n_m) TypeError: init() missing 1 required positional argument: 'EachJob_num_operation' 运行PPOwithValue.py文件时出现这个错误应该怎么解决

98twilight commented 8 months ago

非常抱歉在这个时刻打扰到你,很荣幸阅读你的论文,从中受到了很多启发。但是我在使用你的源码去实验的过程中遇见了一些问题,希望能请教一下你。在使用validation_realWorld.py时遇见了这样的问题,不知道该怎么样解决。 Traceback (most recent call last): File "D:\End-to-end-DRL-for-FJSP-main\FJSP_RealWorld\validation_realWorld.py", line 219, in a = test(filepath, data_file) File "D:\End-to-end-DRL-for-FJSP-main\FJSP_RealWorld\validation_realWorld.py", line 162, in test ppo.policy_job.load_state_dict(torch.load(job_path1)) File "D:\anaconda\envs\pytorch\lib\site-packages\torch\nn\modules\module.py", line 1482, in load_state_dict raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( RuntimeError: Error(s) in loading state_dict for Job_Actor: Unexpected key(s) in state_dict: "feature_extract.mlps.0.linears.0.weight", "feature_extract.mlps.0.linears.0.bias", "feature_extract.mlps.0.linears.1.weight", "feature_extract.mlps.0.linears.1.bias", "feature_extract.mlps.0.linears.2.weight", "feature_extract.mlps.0.linears.2.bias", "feature_extract.mlps.0.batch_norms.0.weight", "feature_extract.mlps.0.batch_norms.0.bias", "feature_extract.mlps.0.batch_norms.0.running_mean", "feature_extract.mlps.0.batch_norms.0.running_var", "feature_extract.mlps.0.batch_norms.0.num_batches_tracked", "feature_extract.mlps.0.batch_norms.1.weight", "feature_extract.mlps.0.batch_norms.1.bias", "feature_extract.mlps.0.batch_norms.1.running_mean", "feature_extract.mlps.0.batch_norms.1.running_var", "feature_extract.mlps.0.batch_norms.1.num_batches_tracked", "feature_extract.mlps.1.linears.0.weight", "feature_extract.mlps.1.linears.0.bias", "feature_extract.mlps.1.linears.1.weight", "feature_extract.mlps.1.linears.1.bias", "feature_extract.mlps.1.linears.2.weight", "feature_extract.mlps.1.linears.2.bias", "feature_extract.mlps.1.batch_norms.0.weight", "feature_extract.mlps.1.batch_norms.0.bias", "feature_extract.mlps.1.batch_norms.0.running_mean", "feature_extract.mlps.1.batch_norms.0.running_var", "feature_extract.mlps.1.batch_norms.0.num_batches_tracked", "feature_extract.mlps.1.batch_norms.1.weight", "feature_extract.mlps.1.batch_norms.1.bias", "feature_extract.mlps.1.batch_norms.1.running_mean", "feature_extract.mlps.1.batch_norms.1.running_var", "feature_extract.mlps.1.batch_norms.1.num_batches_tracked", "feature_extract.bn.weight", "feature_extract.bn.bias", "feature_extract.bn.running_mean", "feature_extract.bn.running_var", "feature_extract.bn.num_batches_tracked", "feature_extract.batch_norms.0.weight", "feature_extract.batch_norms.0.bias", "feature_extract.batch_norms.0.running_mean", "feature_extract.batch_norms.0.running_var", "feature_extract.batch_norms.0.num_batches_tracked", "feature_extract.batch_norms.1.weight", "feature_extract.batch_norms.1.bias", "feature_extract.batch_norms.1.running_mean", "feature_extract.batch_norms.1.running_var", "feature_extract.batch_norms.1.num_batches_tracked".

请问,您解决了这个问题吗

miemiedexiaoyang commented 7 months ago

请问,您解决了这个问题吗