当n=10、15、20时均可以正常进行训练,但当我设置为25、30、40时,却会出现错误:
Iteration 0 ----------------
Sampling set of tasks/goals for this meta-batch...
0% [##############################] 100% | ETA: 00:00:00
Total time elapsed: 00:00:26
Processing samples...
Traceback (most recent call last):
File "/home/liujiamin/anaconda3/envs/tf-1.15/lib/python3.6/site-packages/numpy/lib/shape_base.py", line 867, in split
len(indices_or_sections)
TypeError: object of type 'int' has no len()
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "meta_trainer.py", line 189, in
avg_ret, avg_loss, avg_latencies = trainer.train()
File "meta_trainer.py", line 55, in train
policy_losses, value_losses = self.algo.UpdatePPOTarget(samples_data, batch_size=self.inner_batch_size )
File "/mnt/hgfs/myshare/metarl-offloading-master/meta_algos/MRLCO.py", line 139, in UpdatePPOTarget
policy_losses, value_losses = self.UpdatePPOTargetPerTask(task_samples[i], i, batch_size)
File "/mnt/hgfs/myshare/metarl-offloading-master/meta_algos/MRLCO.py", line 158, in UpdatePPOTargetPerTask
observations_batchs = np.split(np.array(task_samples['observations']), batch_number)
File "<__array_function__ internals>", line 6, in split
File "/home/liujiamin/anaconda3/envs/tf-1.15/lib/python3.6/site-packages/numpy/lib/shape_base.py", line 871, in split
if N % sections:
ZeroDivisionError: integer division or modulo by zero
当复现第二个实验时,同时训练不同任务数量的dag,又出现以下错误:
---------------- Iteration 0 ----------------
Sampling set of tasks/goals for this meta-batch...
/mnt/hgfs/myshare/metarl-offloading-master/samplers/seq2seq_meta_sampler.py:90: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray
obs_per_task = np.array(obses)
Traceback (most recent call last):
File "meta_trainer.py", line 184, in
avg_ret, avg_loss, avg_latencies = trainer.train()
File "meta_trainer.py", line 43, in train
paths = self.sampler.obtain_samples(log=False, log_prefix='')
File "/mnt/hgfs/myshare/metarl-offloading-master/samplers/seq2seq_meta_sampler.py", line 90, in obtain_samples
obs_per_task = np.array(obses)
ValueError: could not broadcast input array from shape (100,30,17) into shape (100)
当n=10、15、20时均可以正常进行训练,但当我设置为25、30、40时,却会出现错误: Iteration 0 ---------------- Sampling set of tasks/goals for this meta-batch... 0% [##############################] 100% | ETA: 00:00:00 Total time elapsed: 00:00:26 Processing samples... Traceback (most recent call last): File "/home/liujiamin/anaconda3/envs/tf-1.15/lib/python3.6/site-packages/numpy/lib/shape_base.py", line 867, in split len(indices_or_sections) TypeError: object of type 'int' has no len()
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "meta_trainer.py", line 189, in
avg_ret, avg_loss, avg_latencies = trainer.train()
File "meta_trainer.py", line 55, in train
policy_losses, value_losses = self.algo.UpdatePPOTarget(samples_data, batch_size=self.inner_batch_size )
File "/mnt/hgfs/myshare/metarl-offloading-master/meta_algos/MRLCO.py", line 139, in UpdatePPOTarget
policy_losses, value_losses = self.UpdatePPOTargetPerTask(task_samples[i], i, batch_size)
File "/mnt/hgfs/myshare/metarl-offloading-master/meta_algos/MRLCO.py", line 158, in UpdatePPOTargetPerTask
observations_batchs = np.split(np.array(task_samples['observations']), batch_number)
File "<__array_function__ internals>", line 6, in split
File "/home/liujiamin/anaconda3/envs/tf-1.15/lib/python3.6/site-packages/numpy/lib/shape_base.py", line 871, in split
if N % sections:
ZeroDivisionError: integer division or modulo by zero
当复现第二个实验时,同时训练不同任务数量的dag,又出现以下错误: ---------------- Iteration 0 ---------------- Sampling set of tasks/goals for this meta-batch... /mnt/hgfs/myshare/metarl-offloading-master/samplers/seq2seq_meta_sampler.py:90: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray obs_per_task = np.array(obses) Traceback (most recent call last): File "meta_trainer.py", line 184, in
avg_ret, avg_loss, avg_latencies = trainer.train()
File "meta_trainer.py", line 43, in train
paths = self.sampler.obtain_samples(log=False, log_prefix='')
File "/mnt/hgfs/myshare/metarl-offloading-master/samplers/seq2seq_meta_sampler.py", line 90, in obtain_samples
obs_per_task = np.array(obses)
ValueError: could not broadcast input array from shape (100,30,17) into shape (100)