Open zaccharieramzi opened 3 years ago
I guess it's because I need to install auto_mtf
. This wasn't clearly mentioned in the docs I think: there is the mention that it's a sub-package but not that we need to install it.
Also it could be nice to have a documentation stating how to install it. I can try to figure this out and do a PR.
@zaccharieramzi have the same , have solved it?
@1106944911 I think I did but I am not sure exactly what's wrong.
Basically, the first thing is that you need to import auto_mtf
before you can use mtf.auto_mtf
.
So it's going to be something like:
import mesh_tensorflow as mtf
import mesh_tensorflow.auto_mtf # this line is used to have auto_mtf
# your code
layout = mtf.auto_mtf.layout(graph, mesh_shape, outputs)
When I did this, the AttributeError
went away, but I had a ModuleNotFoundError
related to ortools
. So I had to manually install ortools
: pip install ortools
.
After that everything went smoothly.
However, I don't understand why I needed to install ortools
given that it's listed as a requirement in the setup file for auto_mtf
(see here).
@1106944911 thank you
In this example, we can see how to set the layout to be automatically picked.
However, when using this in my
model_fn
, basically replacing this line, I find myself with the following error:AttributeError: module 'mesh_tensorflow' has no attribute 'auto_mtf'
.The full stacktrace is the following: