Huggingface transformers error: "from transformers.trainer_utils import get_last_checkpoint,is_main_process" - tensorflow

I am using Google Colab and trying to use transformers. first, I installed trasnformers using pip, and it installed successfully but I was still unable to import the following functions
from transformers.trainer_utils import get_last_checkpoint,is_main_process
Next I tried to install Transformers from source in a virtual environment. I installed it successfully, but was still getting the same error as shown below.
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-53-d42272f1d6ac> in <module>()
----> 1 from transformers.trainer_utils import get_last_checkpoint,is_main_process
ModuleNotFoundError: No module named 'transformers.trainer_utils'

From comments
The issue fixed after installing "master" version from source as shown
below
pip install git+github.com/huggingface/transformers

Related

rqt_graph pyqt binding of qt_gui_cpp library

I am using ROS-melodic in ubuntu 18.04 LTS. I am getting this error:
Could not import "pyqt" bindings of qt_gui_cpp library - so C++ plugins will not be available:
Traceback (most recent call last):
File "/opt/ros/melodic/lib/python2.7/dist-packages/qt_gui_cpp/cpp_binding_helper.py", line 43, in <module>
from . import libqt_gui_cpp_sip
ImportError: dynamic module does not define module export function (PyInit_libqt_gui_cpp_sip)
however I have installed pyqt5 and pydot manually, rqt_graph shows up but with this warning. I want to know what can I do to get it right? Is this going to be problem in future? Now rqt_graph is loading but I don't know if this will mess up/create lacking in the graph?
Try uninstalling double packages if any using
pip3 uninstall PyQt5-sip PyQt5
Then try importing it in python3 to check if any other version is there.
If the import is successful then try running the command again
rosrun rqt_graph rqt_graph
if still some error exists install
pip3 install PyQt5==5.12

ModuleNotFoundError: No module named 'tensorflow.contrib'

I cannot use edward package on google cola.
I have the below error:
ModuleNotFoundError Traceback (most recent call last)
in ()
----> 1 import edward
4 frames
/usr/local/lib/python3.6/dist-packages/edward/models/dirichlet_process.py in ()
6
7 from edward.models.random_variable import RandomVariable
----> 8 from tensorflow.contrib.distributions import Distribution
9
10 try:
ModuleNotFoundError: No module named 'tensorflow.contrib'
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.
To view examples of installing some common dependencies, click the
"Open Examples" button below.
Uninstalling current/latest version of tensorflow and installing version 1.14 resolved it for me. Looks like they removed tensorflow.contrib from tensorflow version >1.14.
!pip uninstall tensorflow
!pip install tensorflow==1.14

Module Not found error on Google Colaboratory

Getting a weird import error when running the following code.
! pip install --user --upgrade git+https://github.com/broadinstitute/keras-resnet
import keras
import keras_resnet
Basically, I'm trying to install keras_resnet for keras_retinanet on Google colab however I'm getting a not found error. Output is below. The installation completes but then the import fails. Tested it locally and it works only fails on Google Colaboratory.
Running setup.py install for keras-resnet ... - \ done
Successfully installed keras-resnet-0.0.8
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-25-4521fd3221d7> in <module>()
2 #os.chdir('keras-retinanet')
3 import keras
----> 4 import keras_resnet
5 #from keras-retinanet.keras_retinanet.models.resnet import custom_objects
6 #model = keras.models.load_model('/path/to/model.h5', custom_objects=custom_objects)
ModuleNotFoundError: No module named 'keras_resnet'
Try dropping the --user? This worked for me:
!pip install --upgrade git+https://github.com/broadinstitute/keras-resnet
import keras
import keras_resnet

No module named 'pandastable'

I'm trying to change table wrote by me on tkinter with the pandastable one in order to do the handling of data directly from a pandas.DataFrame.
But despite I have already installed Anaconda3 with matlplotlib, numpy, pandas ect. modules when i would like to import pandastable I have trouble.
This is the problem:
import pandastable
Traceback (most recent call last):
File "<pyshell#8>", line 1, in <module>
import pandastable
ImportError: No module named 'pandastable'
pip install pandastable
Requires python>=3.3 or 2.7 and numpy, matplotlib and pandas.
See: pandastable on github
edit: You may have multiple Python environments installed on your machine. Anaconda uses conda install to keep things in check but pandastable doesn't seem to be available through Anaconda packages. Make sure you are installing to the same Python environment that your script uses. You might also try:
pip3 install pandastable

faulty install of Matplotlib

Windows7 with python 3.4 32bit.
Downloaded and ran install according to this related question.
However I have a different error, so I posted a new question.
I removed the faulty install and tried the installer from the sourceforge link off matplotlib.org. Both finish claiming to be successful, though testing results in an error (both resulting in the same error)
from matplotlib import *
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
from matplotlib import *
File "C:\Python34\lib\site-packages\matplotlib\__init__.py", line 105, in <module>
import six
ImportError: No module named 'six'
Actually you need to install six. As given in Python Error: "ImportError: No module named six"
Better you can install pip and install all libraries using that.