Getting import error
See original GitHub issueI am trying to install Intel Extension for PyTorch in a Docker container. I get error:
File "/usr/src/app/.../Predictor.py", line 4, in <module>
import intel_extension_for_pytorch as ipex
File "/usr/local/lib/python3.8/site-packages/intel_extension_for_pytorch/__init__.py", line 13, in <module>
from . import quantization
File "/usr/local/lib/python3.8/site-packages/intel_extension_for_pytorch/quantization/__init__.py", line 1, in <module>
from .quantization_utils import calibrate, convert
File "/usr/local/lib/python3.8/site-packages/intel_extension_for_pytorch/quantization/quantization_utils.py", line 6, in <module>
import intel_extension_for_pytorch._C as core
ImportError: /usr/local/lib/python3.8/site-packages/intel_extension_for_pytorch/lib/libintel-ext-pt-cpu.so: undefined symbol: _ZNK3c104Type14isSubtypeOfExtERKS0_PSo
make: *** [Makefile:6: ssp_train] Error 1
My Dockerfile:
FROM python:3.8
ENV POETRY_VIRTUALENVS_CREATE=false \
POETRY_VERSION=1.1.12 \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1
WORKDIR /usr/src/app
RUN apt-get update
RUN apt-get --yes install libsnappy-dev libgomp1
COPY ./poetry.lock ./poetry.lock
COPY ./pyproject.toml ./pyproject.toml
RUN pip install poetry
RUN poetry install --no-interaction
COPY . .
RUN cp .env.example .env
CMD ["python3", "-m", "train_model"]
I am using poetry
for package management and pip
for package installation. How can I fix this error? I have only added intel-extension-for-pytorch = "1.11.*"
to my dependencies, other packages are e.g. numpy
, scipy
, pytorch
(regular pip
versions).
Issue Analytics
- State:
- Created a year ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
How to Fix ImportError: Cannot Import Name in Python - Rollbar
The Python ImportError: cannot import name error occurs when an imported class is not accessible or is in a circular dependency.
Read more >Understanding the Functions of ImportError in Python - eduCBA
In Python, ImportError occurs when the Python program tries to import module which does not exist in the private table. This exception can...
Read more >Python error "ImportError: No module named" - Stack Overflow
Python error "ImportError: No module named" · Check that you have read permission to that file from python. · Please be sure to...
Read more >Python Import Error (ModuleNotFoundError) - Finxter
Python's ImportError ( ModuleNotFoundError ) indicates that you tried to import a module that Python doesn't find. It can usually be eliminated by...
Read more >Python Exception Handling: ImportError and ... - Airbrake Blog
The ImportError is raised when an import statement has trouble successfully importing the specified module. Typically, such a problem is due to ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The model is MLP in PyTorch, 3 hidden layers, learning rate 0.01, dropout 0.3. Inputs are text embeddings from DistilBERT, length 768 dense vectors. Layer shapes: 768 (input), 64, 32, 1 (regression target).
CPU: Intel® Core™ i7-10850H CPU @ 2.70GHz × 12
MSELoss