<h2 dir="auto">🐛 Bug</h2>
<p dir="auto"><code class="notranslate">import torch</code> crashed segmentation fault</p>
<h2 dir="auto">To Reproduce</h2>
<p dir="auto">Steps to reproduce the behavior:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="1. docker run -it python:3.6.9 bash
2. pip install scikit-learn torch
3. python -c &quot;import sklearn, torch&quot;"><pre class="notranslate"><code class="notranslate">1. docker run -it python:3.6.9 bash
2. pip install scikit-learn torch
3. python -c "import sklearn, torch"
</code></pre></div>
<blockquote>
<p dir="auto">segmentation fault</p>
</blockquote>
<p dir="auto">at first <code class="notranslate">import torch</code> and then <code class="notranslate">import sklearn</code><br>
it works well.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="3. python -c &quot;import torch, sklearn&quot;"><pre class="notranslate"><code class="notranslate">3. python -c "import torch, sklearn"
</code></pre></div>
<h2 dir="auto">Expected behavior</h2>
<p dir="auto">not happen the <code class="notranslate">segmentation fault</code></p>
<h2 dir="auto">Environment</h2>
<p dir="auto">Please copy and paste the output from our<br>
<a href="https://raw.githubusercontent.com/pytorch/pytorch/master/torch/utils/collect_env.py" rel="nofollow">environment collection script</a><br>
(or fill out the checklist below manually).</p>
<p dir="auto">You can get the script and run it with:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="wget https://raw.githubusercontent.com/pytorch/pytorch/master/torch/utils/collect_env.py
# For security purposes, please check the contents of collect_env.py before running it.
python collect_env.py"><pre class="notranslate"><code class="notranslate">wget https://raw.githubusercontent.com/pytorch/pytorch/master/torch/utils/collect_env.py
# For security purposes, please check the contents of collect_env.py before running it.
python collect_env.py
</code></pre></div>
<ul dir="auto">
<li>PyTorch Version 1.4.0:</li>
<li>scikit-learn Version 0.22:</li>
<li>OS (Linux (docker python image)):</li>
<li>How you installed PyTorch (<code class="notranslate">pip</code>):</li>
</ul>
<h2 dir="auto">Additional context</h2>
<h2 dir="auto"><g-emoji class="g-emoji" alias="bug" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f41b.png">🐛</g-emoji> Bug</h2>
<p dir="auto">Import <code class="notranslate">torch</code> after <code class="notranslate">sklearn</code> causes a segfault.</p>
<h2 dir="auto">To Reproduce</h2>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import sklearn
import torch
print(torch.__version__)
print(sklearn.__version__)"><pre class="notranslate"><code class="notranslate">import sklearn
import torch
print(torch.__version__)
print(sklearn.__version__)
</code></pre></div>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/11019190/71001688-15df3680-20de-11ea-8441-16a58497c70b.png"><img src="https://user-images.githubusercontent.com/11019190/71001688-15df3680-20de-11ea-8441-16a58497c70b.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">In reverse order:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import torch
import sklearn
print(torch.__version__)
print(sklearn.__version__)"><pre class="notranslate"><code class="notranslate">import torch
import sklearn
print(torch.__version__)
print(sklearn.__version__)
</code></pre></div>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/11019190/71001720-255e7f80-20de-11ea-9338-5f4adcf1ac2c.png"><img src="https://user-images.githubusercontent.com/11019190/71001720-255e7f80-20de-11ea-9338-5f4adcf1ac2c.png" alt="image" style="max-width: 100%;"></a></p>
<h2 dir="auto">Environment</h2>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="PyTorch version: 1.3.1
Is debug build: No
CUDA used to build PyTorch: 10.1.243

OS: Manjaro Linux
GCC version: (GCC) 9.2.0
CMake version: version 3.16.0

Python version: 3.7
Is CUDA available: Yes
CUDA runtime version: 10.2.89
GPU models and configuration: GPU 0: GeForce RTX 2080 Ti
Nvidia driver version: 430.64
cuDNN version: /usr/lib/libcudnn.so.7.6.5

Versions of relevant libraries:
[pip3] numpy==1.17.4
[pip3] torch==1.3.1
[pip3] torchvision==0.4.2
[conda] Could not collect"><pre class="notranslate"><code class="notranslate">PyTorch version: 1.3.1
Is debug build: No
CUDA used to build PyTorch: 10.1.243

OS: Manjaro Linux
GCC version: (GCC) 9.2.0
CMake version: version 3.16.0

Python version: 3.7
Is CUDA available: Yes
CUDA runtime version: 10.2.89
GPU models and configuration: GPU 0: GeForce RTX 2080 Ti
Nvidia driver version: 430.64
cuDNN version: /usr/lib/libcudnn.so.7.6.5

Versions of relevant libraries:
[pip3] numpy==1.17.4
[pip3] torch==1.3.1
[pip3] torchvision==0.4.2
[conda] Could not collect
</code></pre></div>
<h2 dir="auto">Additional context</h2>
<p dir="auto">Related closed issues:<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="243779309" data-permission-text="Title is private" data-url="https://github.com/pytorch/pytorch/issues/2143" data-hovercard-type="issue" data-hovercard-url="/pytorch/pytorch/issues/2143/hovercard" href="https://github.com/pytorch/pytorch/issues/2143">#2143</a><br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="208695074" data-permission-text="Title is private" data-url="https://github.com/pytorch/pytorch/issues/786" data-hovercard-type="issue" data-hovercard-url="/pytorch/pytorch/issues/786/hovercard" href="https://github.com/pytorch/pytorch/issues/786">#786</a></p>
<p dir="auto">cc <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ezyang/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ezyang">@ezyang</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/gchanan/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/gchanan">@gchanan</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/zou3519/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/zou3519">@zou3519</a></p>