我有一个 Trax 循环对象,我想从中提取一个任务对象。下面的代码返回错误AttributeError: 'Loop' object has no attribute '_task'
。你对如何解决这个问题有什么建议吗?
背景信息:我正在尝试在 GPU 上运行,设置 Coursera 课程“ Natural Language Processign with Attention Models ”的 W4 分配代码。
test_loop = training_loop(ReformerLM, train_stream, eval_stream)
type(test_loop)
train_task = test_loop._task
这是错误消息:
<class 'trax.supervised.training.Loop'>
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-34-937f26e690d0> in <module>
1 test_loop = training_loop(ReformerLM, train_stream, eval_stream)
2 print(type(test_loop))
----> 3 train_task = test_loop._task
4 #eval_task = test_loop._eval_task
5
AttributeError: 'Loop' object has no attribute '_task'