Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X
I assumed that the "as" phrase just created an alias for an imported module. However, in the following code, "import" fails with the "as" phrase.
import tensorflow.python.eager as eager
The following error occurs as a result of this statement.
Traceback (most recent call last):
File "/home/snippet/prof/importer.py", line 2, in <module>
import tensorflow.python.eager as eager
AttributeError: module 'tensorflow' has no attribute 'python'
When I delete the "as" clause, the "import" function works well. What effect does the "as" clause have on the success or failure of "import"?
This article suggests not using ".eager" when importing "eager" as anything and suggests the following:
from tensorflow.python import eager as eager
This works great, however, I'm not sure why my example is incorrect. could someone please explain
Hi @sachinbhatt.
This post doesn't appear to be ThingWorx related. Can you confirm?
Regards.
--Sharon