google-research / bert

TensorFlow code and pre-trained models for BERT
https://arxiv.org/abs/1810.04805
Apache License 2.0
38.23k stars 9.62k forks source link

Errors when pre-training Bert on local GPU #1335

Open suchunxie opened 2 years ago

suchunxie commented 2 years ago

I got this error "ImportError: cannot import name 'trace' from 'tensorflow.python.profiler" when runing [python run_pretraining.py]. My environment is anaconda, with tensorflow-gpu==1.15.0, python==3.9.7.

I did't do something particular, just git clone google/bert, and cd bert, then python run_pretraining.py.. I downgraded the tensorflow-estimator from 2.4.0-->1.15.1. But the proplem still on.

Can anyone be help? Much appreciated.

suchunxie commented 2 years ago

I solved this problem by referenced others blogs. (sorry I forgot the link.) I tried many envs on conda with different kinds of tensorflow-gpu and python's combination, but its all failed. The only method workable it's tensorflow-gpu=1.11.0(which original bert team applied), and python=3.6