Giter VIP home page Giter VIP logo

Comments (6)

ykim362 avatar ykim362 commented on July 28, 2024

Hi @baiziyuandyufei. I guess you followed the installation procedure.
Can you check the directory path /home/username/.local/lib/python3.6/site-packages/onnxruntime/__init__.py and the installed location with pip are the same?

from fastformers.

baiziyuandyufei avatar baiziyuandyufei commented on July 28, 2024

@ykim362 Thank you!
I used conda env enviroment, so I install the onnxruntime shouldn't use the --user parameter,
so I uninstall onnxruntime and install it by the command pip install examples/fastformers/onnxruntime/onnxruntime-1.4.0-cp36-cp36m-linux_x86_64.whl,

run the command
python examples/fastformers/run_superglue.py --model_type bert --model_name_or_path ../model/fastformers/student_model/student-4L-312 --task_name BoolQ --output_dir ./out --do_eval --data_dir ../dataset/fastformers/BoolQ --per_instance_eval_batch_size 1 --do_lower_case --max_seq_length 512 --use_onnxrt --no_cuda

but there is also have the error message:

Traceback (most recent call last):
  File "examples/fastformers/run_superglue.py", line 1901, in <module>
    main()
  File "examples/fastformers/run_superglue.py", line 1840, in main
    from onnxruntime import ExecutionMode, InferenceSession, SessionOptions
  File "/home/username/anaconda3/envs/fastformers/lib/python3.6/site-packages/onnxruntime/__init__.py", line 13, in <module>
    from onnxruntime.capi._pybind_state import get_all_providers, get_available_providers, get_device, set_seed, \
ImportError: cannot import name 'get_all_providers'

before the error message, there is a warning

/home/username/anaconda3/envs/fastformers/lib/python3.6/site-packages/onnxruntime/capi/_pybind_state.py:14: UserWarning: Cannot load onnxruntime.capi. Error: '/lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.27' not found (required by /home/username/anaconda3/envs/fastformers/lib/python3.6/site-packages/onnxruntime/capi/onnxruntime_pybind11_state.so)'.

I install the glibc_2.27, user the command below

wget http://ftp.gnu.org/gnu/glibc/glibc-2.27.tar.gz
tar zxvf glibc-2.27.tar.gz
cd glibc-2.27
mkdir build
cd build
../configure --prefix=/opt/glibc-2.27
make -j4
sudo make install
export LD_LIBRARY_PATH="/opt/glibc-2.27/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"

then, run the command
python examples/fastformers/run_superglue.py --model_type bert --model_name_or_path ../model/fastformers/student_model/student-4L-312 --task_name BoolQ --output_dir ./out --do_eval --data_dir ../dataset/fastformers/BoolQ --per_instance_eval_batch_size 1 --do_lower_case --max_seq_length 512 --use_onnxrt --no_cuda

get error :

segment fault

I guess the problem is the glibc version,so I change to the ubuntu18.04(replace the ubuntu16.04),then it's OK.

from fastformers.

ykim362 avatar ykim362 commented on July 28, 2024

Is it running okay on Ubuntu 18.04? And, can you let me know your CPU model number?

from fastformers.

baiziyuandyufei avatar baiziyuandyufei commented on July 28, 2024

@ykim362 Yes, Ubuntu18.04 is OK.
model name : Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz

from fastformers.

ykim362 avatar ykim362 commented on July 28, 2024

@baiziyuandyufei Thanks for the confirmation!
It turns out that the binary has a dependency on glibc version. I am working on merging it into the main branch of onnxruntime. Once, it's done, I expect it supports broader environment.

from fastformers.

baiziyuandyufei avatar baiziyuandyufei commented on July 28, 2024

@ykim362 Thanks.

from fastformers.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.