咨询个机器学习PAI问题哈:ev 必须定义在特定的scope下吗?ValueError: colocate_vars_with
must only be passed a variable created in this tf.distribute.Strategy.scope(), not:
Failed to execute system command. (exit code: 251.)看着是和我用的分布式策略有关系?
distribution = tf.contrib.distribute.ParameterServerStrategy()
是的,目前不支持,如果你仅仅是想把参数放ps,不用这个Strategy也可以的,此回答整理自钉群“DeepRec用户群”
看起来您正在使用 TensorFlow 参数服务器(Parameter Server)策略,并遇到了“colocate_vars_with 必须只在当前策略作用域中传递变量”的错误。这是因为 TensorFlow 的某些 API 只能在特定的策略作用域中使用,以确保变量在适当的设备上被分配和训练。
为了修复此问题,您需要确保您的 ev 变量是在 Parameter Server 策略作用域中定义的,如下所示: