question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Segmentation Fault when Importing AutoGluon

See original GitHub issue

We have noticed that a specific order of import AutoGluon modules will result in seg fault. For example,

import autogluon.text  # same applies to autogluon.multimodal
from autogluon.vision import ImagePredictor

and

import autogluon.text. # same applies to autogluon.multimodal
import autogluon.timeseries

will result in

free(): invalid size
Aborted (core dumped)

This is because of some underlying issue with mxnet when it is used along with pytorch. There is not too much AutoGluon team can do about this, but we are actively working toward getting rid of mxnet.

To get around with it, simply reverse the order you import. For example,

from autogluon.vision import ImagePredictor
import autogluon.text

and

import autogluon.timeseries
import autogluon.text

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
yinweisucommented, Nov 8, 2022

Created a new env and wasn’t able to reproduce it either.

(temp) ubuntu@ip-172-31-11-12:~/yinweisu/autogluon$ pip3 freeze | grep mxnet
mxnet-cu110==1.9.1
(temp) ubuntu@ip-172-31-11-12:~/yinweisu/autogluon$ pip3 freeze | grep torch
pytorch-lightning==1.7.7
pytorch-metric-learning==1.3.2
torch==1.12.1
torchmetrics==0.8.2
torchtext==0.13.1
torchvision==0.13.1
(temp) ubuntu@ip-172-31-11-12:~/yinweisu/autogluon$ python3
Python 3.8.13 | packaged by conda-forge | (default, Mar 25 2022, 06:04:18) 
[GCC 10.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import autogluon.text
>>> from autogluon.vision import ImagePredictor
/home/ubuntu/anaconda3/envs/temp/lib/python3.8/site-packages/gluoncv/__init__.py:40: UserWarning: Both `mxnet==1.9.1` and `torch==1.12.1+cu102` are installed. You might encounter increased GPU memory footprint if both framework are used at the same time.
  warnings.warn(f'Both `mxnet=={mx.__version__}` and `torch=={torch.__version__}` are installed. '
>>> 

However, according to @gradientsky, there are still reports of such issues. Let’s just keep this thread open for anyone encountered this issue as a reference and close it once we completely remove mxnet in 0.7. @canerturkmen

0reactions
sxjsciencecommented, Nov 15, 2022

This should be related to ImagePredictor hasn’t switched default backend to MXNet.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Segmentation Fault when Importing AutoGluon · Issue #2042
We have noticed that a specific order of import AutoGluon modules will result in seg fault. For example, import autogluon.text # same ...
Read more >
Installation — AutoGluon Documentation 0.6.1 documentation
On MacOS I am getting a segmentation fault when trying to train LightGBM / XGBoost. You need to install libOMP 11 to avoid...
Read more >
AutoGluon-Tabular hyperparameters - Amazon SageMaker
The following table contains the subset of hyperparameters that are required or most commonly used for the Amazon SageMaker AutoGluon-Tabular algorithm.
Read more >
autogluon Changelog - PyUp.io
Because you tried to allocate too many memory regions. Segmentation fault: 11. This error occurred when the machine had many CPU cores (>64...
Read more >
Advancing the State of the Art in AutoML, Now 10x Faster with ...
At GTC 21, AWS shared how the combination of AutoGluon, RAPIDS, and NVIDIA GPU computing ... from autogluon.tabular import TabularPredictor, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found