Skip to content

ImportError: cannot import name 'profiler_v2' from 'tensorflow.python.profiler'  #8243

@ruipingyin

Description

@ruipingyin

When I Using official/recommendation/ncf_keras_main.py, I got:

Traceback (most recent call last):
File "ncf_keras_main.py", line 37, in
from official.recommendation import ncf_common
File "/home/ruyin/Projects/models/official/recommendation/ncf_common.py", line 38, in
from official.utils.misc import keras_utils
File "/home/ruyin/Projects/models/official/utils/misc/keras_utils.py", line 28, in
from tensorflow.python.profiler import profiler_v2 as profiler
ImportError: cannot import name 'profiler_v2' from 'tensorflow.python.profiler' (/home/ruyin/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/profiler/init.py)

what's the reason?

System information
Linux Ubuntu 18.04
TensorFlow version: 2.1, installed from binary
Python version: 3.7
CUDA: 10.1
GPU model: 1080Ti

Metadata

Metadata

Assignees

No one assigned

    Labels

    models:officialmodels that come under official repositorytype:bugBug in the code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions