Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python import failure #47146

Closed
IanSMoyes opened this issue Feb 14, 2021 · 7 comments
Closed

Python import failure #47146

IanSMoyes opened this issue Feb 14, 2021 · 7 comments
Assignees
Labels
stat:awaiting response Status - Awaiting response from author subtype: ubuntu/linux Ubuntu/Linux Build/Installation Issues TF 2.4 for issues related to TF 2.4 type:build/install Build and install issues

Comments

@IanSMoyes
Copy link

System information

  • OS Platform and Distribution (Linux Ubuntu 20 latest update):
  • Mobile device ()Starlabs Star Lite laptop with 8Gb of RAM 113Gb of SSD space:
  • TensorFlow installed from (pip install tensorflow==2.4.1):
  • TensorFlow version: see above
  • Python version: Python 3.8.5 (/usr/bin/python3)
  • Installed using virtualenv? pip? conda?: See above
  • Bazel version (if compiling from source): NA NA
  • GCC/Compiler version (if compiling from source):
  • CUDA/cuDNN version: Dunno
  • GPU model and memory: (description: VGA compatible controller
    product: UHD Graphics 605
    vendor: Intel Corporation
    physical id: 2
    bus info: pci@0000:00:02.0
    version: 03
    width: 64 bits
    clock: 33MHz
    capabilities: pciexpress msi pm vga_controller bus_master cap_list rom
    configuration: driver=i915 latency=0
    resources: irq:132 memory:a0000000-a0ffffff memory:90000000-9fffffff ioport:f000(size=64) memory:c0000-dffff)

Describe the problem
when I import tensorflow into the Thonny shell I get:

Backend terminated or disconnected.Fatal Python error: Illegal instruction

Current thread 0x00007f30949d8740 (most recent call first):
File "", line 219 in _call_with_frames_removed
File "", line 1101 in create_module
File "", line 556 in module_from_spec
File "", line 657 in _load_unlocked
File "", line 975 in _find_and_load_unlocked
File "", line 991 in _find_and_load
File "/usr/lib/python3/dist-packages/thonny/backend.py", line 285 in _custom_import
File "/home/ian/.local/lib/python3.8/site-packages/tensorflow/python/pywrap_tensorflow.py", line 64 in
File "", line 219 in _call_with_frames_removed
File "", line 783 in exec_module
File "", line 671 in _load_unlocked
File "", line 975 in _find_and_load_unlocked
File "", line 991 in _find_and_load
File "", line 219 in _call_with_frames_removed
File "", line 1042 in _handle_fromlist
File "/usr/lib/python3/dist-packages/thonny/backend.py", line 285 in _custom_import
File "/home/ian/.local/lib/python3.8/site-packages/tensorflow/python/init.py", line 39 in
File "", line 219 in _call_with_frames_removed
File "", line 783 in exec_module
File "", line 671 in _load_unlocked
File "", line 975 in _find_and_load_unlocked
File "", line 991 in _find_and_load
File "", line 219 in _call_with_frames_removed
File "", line 961 in _find_and_load_unlocked
File "", line 991 in _find_and_load
File "/usr/lib/python3/dist-packages/thonny/backend.py", line 285 in _custom_import
File "/home/ian/.local/lib/python3.8/site-packages/tensorflow/init.py", line 41 in
File "", line 219 in _call_with_frames_removed
File "", line 783 in exec_module
File "", line 671 in _load_unlocked
File "", line 975 in _find_and_load_unlocked
File "", line 991 in _find_and_load
File "/usr/lib/python3/dist-packages/thonny/backend.py", line 285 in _custom_import
File "", line 1 in
File "/usr/lib/python3/dist-packages/thonny/backend.py", line 1272 in _execute_prepared_user_code
File "/usr/lib/python3/dist-packages/thonny/backend.py", line 1200 in wrapper
File "/usr/lib/python3/dist-packages/thonny/backend.py", line 1213 in wrapper
File "/usr/lib/python3/dist-packages/thonny/backend.py", line 1259 in execute_source
File "/usr/lib/python3/dist-packages/thonny/backend.py", line 814 in _execute_source
File "/usr/lib/python3/dist-packages/thonny/backend.py", line 444 in _cmd_execute_source
File "/usr/lib/python3/dist-packages/thonny/backend.py", line 204 in handle_command
File "/usr/lib/python3/dist-packages/thonny/backend.py", line 146 in mainloop
File "/usr/lib/python3/dist-packages/thonny/backend_launcher.py", line 87 in Use 'Stop/Restart' to restart.Backend terminated or disconnected.Fatal Python error: Illegal instruction

Current thread 0x00007f30949d8740 (most recent call first):
File "", line 219 in _call_with_frames_removed
File "", line 1101 in create_module
File "", line 556 in module_from_spec
File "", line 657 in _load_unlocked
File "", line 975 in _find_and_load_unlocked
File "", line 991 in _find_and_load
File "/usr/lib/python3/dist-packages/thonny/backend.py", line 285 in _custom_import
File "/home/ian/.local/lib/python3.8/site-packages/tensorflow/python/pywrap_tensorflow.py", line 64 in
File "", line 219 in _call_with_frames_removed
File "", line 783 in exec_module
File "", line 671 in _load_unlocked
File "", line 975 in _find_and_load_unlocked
File "", line 991 in _find_and_load
File "", line 219 in _call_with_frames_removed
File "", line 1042 in _handle_fromlist
File "/usr/lib/python3/dist-packages/thonny/backend.py", line 285 in _custom_import
File "/home/ian/.local/lib/python3.8/site-packages/tensorflow/python/init.py", line 39 in
File "", line 219 in _call_with_frames_removed
File "", line 783 in exec_module
File "", line 671 in _load_unlocked
File "", line 975 in _find_and_load_unlocked
File "", line 991 in _find_and_load
File "", line 219 in _call_with_frames_removed
File "", line 961 in _find_and_load_unlocked
File "", line 991 in _find_and_load
File "/usr/lib/python3/dist-packages/thonny/backend.py", line 285 in _custom_import
File "/home/ian/.local/lib/python3.8/site-packages/tensorflow/init.py", line 41 in
File "", line 219 in _call_with_frames_removed
File "", line 783 in exec_module
File "", line 671 in _load_unlocked
File "", line 975 in _find_and_load_unlocked
File "", line 991 in _find_and_load
File "/usr/lib/python3/dist-packages/thonny/backend.py", line 285 in _custom_import
File "", line 1 in
File "/usr/lib/python3/dist-packages/thonny/backend.py", line 1272 in _execute_prepared_user_code
File "/usr/lib/python3/dist-packages/thonny/backend.py", line 1200 in wrapper
File "/usr/lib/python3/dist-packages/thonny/backend.py", line 1213 in wrapper
File "/usr/lib/python3/dist-packages/thonny/backend.py", line 1259 in execute_source
File "/usr/lib/python3/dist-packages/thonny/backend.py", line 814 in _execute_source
File "/usr/lib/python3/dist-packages/thonny/backend.py", line 444 in _cmd_execute_source
File "/usr/lib/python3/dist-packages/thonny/backend.py", line 204 in handle_command
File "/usr/lib/python3/dist-packages/thonny/backend.py", line 146 in mainloop
File "/usr/lib/python3/dist-packages/thonny/backend_launcher.py", line 87 in Use 'Stop/Restart' to restart.

Provide the exact sequence of commands / steps that you executed before running into the problem
pip install tensorflow==2.4.1 # into the terminal

followed by

import tensorflow # into Thonny's shell

the error appears in the shell

Any other info / logs
Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.
NA

@IanSMoyes IanSMoyes added the type:build/install Build and install issues label Feb 14, 2021
@amahendrakar
Copy link
Contributor

@IanSMoyes,
Could you please share the make and model of the CPU on your machine and output of the cat /proc/cpuinfo command with us.

Starting with v1.6, TensorFlow binaries use AVX instructions which may not run on older CPUs. For more information, please take a look at the hardware requirements for installing TensorFlow. Also check similar issues #33038, #29788 for reference.

Thanks!

@amahendrakar amahendrakar added stat:awaiting response Status - Awaiting response from author subtype: ubuntu/linux Ubuntu/Linux Build/Installation Issues TF 2.4 for issues related to TF 2.4 labels Feb 15, 2021
@IanSMoyes
Copy link
Author

IanSMoyes commented Feb 15, 2021 via email

@mihaimaruseac
Copy link
Collaborator

Your CPU does not support AVX. You have to compile from source or use a newer machine / a VM in the cloud.

@tensorflowbutler tensorflowbutler removed the stat:awaiting response Status - Awaiting response from author label Feb 17, 2021
@IanSMoyes
Copy link
Author

Thank you for that helpful information. Can you please post a link to what I have to download and how to install it?

@amahendrakar
Copy link
Contributor

@IanSMoyes,
Please follow this guide to build TensorFlow from source on Linux machines.

Make sure you have all the required dependencies installed as mentioned in the tested build configurations. Thanks!

@amahendrakar amahendrakar added the stat:awaiting response Status - Awaiting response from author label Feb 18, 2021
@mihaimaruseac
Copy link
Collaborator

Closing as duplicate of #33038, #29788 and several others

@google-ml-butler
Copy link

Are you satisfied with the resolution of your issue?
Yes
No

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stat:awaiting response Status - Awaiting response from author subtype: ubuntu/linux Ubuntu/Linux Build/Installation Issues TF 2.4 for issues related to TF 2.4 type:build/install Build and install issues
Projects
None yet
Development

No branches or pull requests

4 participants