Click here to Skip to main content
15,880,405 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I have the following error, and I am new to data science and python I am using python, keras, tensorflow 1.15
Code line: from tensorflow.python.profiler import trace
Error line: ImportError: cannot import name 'trace'

What I have tried:

Upgrading tensorflow but more errors occurred due to incompatiblity between libraries
Posted
Updated 21-Oct-21 2:44am
Comments
Richard MacCutchan 20-Oct-21 4:54am    
You will need to provide more information. Where is 'trace' supposed to be imported from?
Khalid Elejla 20-Oct-21 10:58am    
It's imported from tensorflow.python.profiler import trace
Richard MacCutchan 20-Oct-21 11:19am    
I cannot see that anywhere in the documentation at Module: tf  |  TensorFlow Core v2.6.0[^]. Are you sure the package name is correct?
Khalid Elejla 20-Oct-21 12:46pm    
yes, here is github repositry that contains the code
https://github.com/crowdAI/crowdai-mapping-challenge-mask-rcnn/blob/master/Training.ipynb
Richard MacCutchan 21-Oct-21 4:13am    
I can see nothing in that which has any relevance to your question. However, if you are trying to implement someone else's project and you have problems with it, then you should contact the person who wrote it.

1 solution

That github repository has nothing to do with Trace.

There is no trace in tensorflow.python.profiler.

You should use either tensorflow.profiler.experimental.Trace or tensorflow.autograph.trace depending on your (uncommunicated) need and as advised in your StackOverFlow post of the same question.

Alternatively, you might be trying to use a Trace function from a completely different library - we can't help you with that one.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900