简体   繁体   English

有tpu_trainer_lib的替代方法吗?

[英]Is there an alternative to tpu_trainer_lib?

I have been trying to run google's tensor2tensor ( https://github.com/tensorflow/tensor2tensor ) locally but it chokes when it gets to this bit: 我一直在尝试在本地运行google的tensor2tensor( https://github.com/tensorflow/tensor2tensor ),但是到这一点时它会阻塞:

from tensor2tensor.tpu import tpu_trainer_lib

Which makes sense because I don't have TPUs in my Mac. 这是有道理的,因为我的Mac中没有TPU。 Is there an alternative to that function? 该功能有替代方法吗?

Here's the error message 这是错误消息

ModuleNotFoundError: No module named 'tensor2tensor.tpu'

You should probably be able to replace it with : 您应该可以将其替换为:

from tensor2tensor.utils import trainer_lib 从tensor2tensor.utils导入trainer_lib

And then call the appropriate methods from trainer_lib. 然后从trainer_lib调用适当的方法。

It seems you have mixed different versions of Tensor2Tensor. 看来您混合使用了不同版本的Tensor2Tensor。 In the recent version, there is no tpu_trainer_lib (it has been renamed). 在最新版本中,没有tpu_trainer_lib (已重命名)。 Even in the few versions where such file existed, it supported training on TPU, GPU and CPU, there are just some if-then-else branches for TPU-specific code. 即使在存在该文件的少数版本中,它也支持在TPU,GPU和CPU上进行训练,对于TPU特定的代码,只有一些if-then-else分支。 By the way, TPUs are available currently only for Google employees. 顺便说一句,TPU目前仅适用于Google员工。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM