blob: 3854d7d7c3ad4e5006f04e3db72ddfdca7fbeb1b [file] [log] [blame]
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><title>Cài đặt · Apache SINGA</title><meta name="viewport" content="width=device-width"/><meta name="generator" content="Docusaurus"/><meta name="description" content="&lt;!--- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the &quot;License&quot;); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --&gt;"/><meta name="docsearch:version" content="3.1.0_Viet"/><meta name="docsearch:language" content="en"/><meta property="og:title" content="Cài đặt · Apache SINGA"/><meta property="og:type" content="website"/><meta property="og:url" content="https://singa.apache.org/"/><meta property="og:description" content="&lt;!--- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the &quot;License&quot;); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --&gt;"/><meta property="og:image" content="https://singa.apache.org/img/singa_twitter_banner.jpeg"/><meta name="twitter:card" content="summary"/><meta name="twitter:image" content="https://singa.apache.org/img/singa_twitter_banner.jpeg"/><link rel="shortcut icon" href="/img/favicon.ico"/><link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.css"/><link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css"/><link rel="alternate" type="application/atom+xml" href="https://singa.apache.org/blog/atom.xml" title="Apache SINGA Blog ATOM Feed"/><link rel="alternate" type="application/rss+xml" href="https://singa.apache.org/blog/feed.xml" title="Apache SINGA Blog RSS Feed"/><script type="text/javascript" src="https://buttons.github.io/buttons.js"></script><script src="https://unpkg.com/vanilla-back-to-top@7.1.14/dist/vanilla-back-to-top.min.js"></script><script>
document.addEventListener('DOMContentLoaded', function() {
addBackToTop(
{"zIndex":100}
)
});
</script><script src="/js/scrollSpy.js"></script><link rel="stylesheet" href="/css/main.css"/><script src="/js/codetabs.js"></script></head><body class="sideNavVisible separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/"><img class="logo" src="/img/singa.png" alt="Apache SINGA"/></a><a href="/versions"><h3>3.1.0_Viet</h3></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class="siteNavGroupActive siteNavItemActive"><a href="/docs/3.1.0_Viet/installation" target="_self">Docs</a></li><li class=""><a href="/docs/3.1.0_Viet/source-repository" target="_self">Community</a></li><li class=""><a href="/blog/" target="_self">News</a></li><li class=""><a href="https://apache-singa.readthedocs.io/en/latest/" target="_self">API</a></li><li class="navSearchWrapper reactNavSearchWrapper"><input type="text" id="search_input_react" placeholder="Search" title="Search"/></li><li class=""><a href="https://github.com/apache/singa" target="_self">GitHub</a></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><div class="hamburger-menu"><div class="line1"></div><div class="line2"></div><div class="line3"></div></div></div><h2><i></i><span>Getting Started</span></h2><div class="tocToggler" id="tocToggler"><i class="icon-toc"></i></div></div><div class="navGroups"><div class="navGroup"><h3 class="navGroupCategoryTitle">Getting Started</h3><ul class=""><li class="navListItem navListItemActive"><a class="navItem" href="/docs/3.1.0_Viet/installation">Cài đặt</a></li><li class="navListItem"><a class="navItem" href="/docs/3.1.0_Viet/software-stack">Software Stack</a></li><li class="navListItem"><a class="navItem" href="/docs/3.1.0_Viet/examples">Ví Dụ</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Guides</h3><ul class=""><li class="navListItem"><a class="navItem" href="/docs/3.1.0_Viet/device">Device</a></li><li class="navListItem"><a class="navItem" href="/docs/3.1.0_Viet/tensor">Tensor</a></li><li class="navListItem"><a class="navItem" href="/docs/3.1.0_Viet/autograd">Autograd</a></li><li class="navListItem"><a class="navItem" href="/docs/3.1.0_Viet/optimizer">Optimizer</a></li><li class="navListItem"><a class="navItem" href="/docs/3.1.0_Viet/graph">Model</a></li><li class="navListItem"><a class="navItem" href="/docs/3.1.0_Viet/onnx">ONNX</a></li><li class="navListItem"><a class="navItem" href="/docs/3.1.0_Viet/dist-train">Distributed Training</a></li><li class="navListItem"><a class="navItem" href="/docs/3.1.0_Viet/time-profiling">Time Profiling</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Development</h3><ul class=""><li class="navListItem"><a class="navItem" href="/docs/3.1.0_Viet/downloads">Tải SINGA</a></li><li class="navListItem"><a class="navItem" href="/docs/3.1.0_Viet/build">Cài đặt SINGA từ Nguồn (Source)</a></li><li class="navListItem"><a class="navItem" href="/docs/3.1.0_Viet/contribute-code">Tham gia viết code</a></li><li class="navListItem"><a class="navItem" href="/docs/3.1.0_Viet/contribute-docs">Tham gia chỉnh sửa Hướng Dẫn Sử Dụng</a></li><li class="navListItem"><a class="navItem" href="/docs/3.1.0_Viet/how-to-release">Chuẩn bị trước khi phát hành</a></li><li class="navListItem"><a class="navItem" href="/docs/3.1.0_Viet/git-workflow">Quy Trình Sử Dụng Git</a></li></ul></div></div></section></div><script>
var coll = document.getElementsByClassName('collapsible');
var checkActiveCategory = true;
for (var i = 0; i < coll.length; i++) {
var links = coll[i].nextElementSibling.getElementsByTagName('*');
if (checkActiveCategory){
for (var j = 0; j < links.length; j++) {
if (links[j].classList.contains('navListItemActive')){
coll[i].nextElementSibling.classList.toggle('hide');
coll[i].childNodes[1].classList.toggle('rotate');
checkActiveCategory = false;
break;
}
}
}
coll[i].addEventListener('click', function() {
var arrow = this.childNodes[1];
arrow.classList.toggle('rotate');
var content = this.nextElementSibling;
content.classList.toggle('hide');
});
}
document.addEventListener('DOMContentLoaded', function() {
createToggler('#navToggler', '#docsNav', 'docsSliderActive');
createToggler('#tocToggler', 'body', 'tocActive');
var headings = document.querySelector('.toc-headings');
headings && headings.addEventListener('click', function(event) {
var el = event.target;
while(el !== headings){
if (el.tagName === 'A') {
document.body.classList.remove('tocActive');
break;
} else{
el = el.parentNode;
}
}
}, false);
function createToggler(togglerSelector, targetSelector, className) {
var toggler = document.querySelector(togglerSelector);
var target = document.querySelector(targetSelector);
if (!toggler) {
return;
}
toggler.onclick = function(event) {
event.preventDefault();
target.classList.toggle(className);
};
}
});
</script></nav></div><div class="container mainContainer docsContainer"><div class="wrapper"><div class="post"><header class="postHeader"><a class="edit-page-link button" href="https://github.com/apache/singa-doc/blob/master/docs-site/docs/installation.md" target="_blank" rel="noreferrer noopener">Edit</a><h1 id="__docusaurus" class="postHeaderTitle">Cài đặt</h1></header><article><div><span><!--- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -->
<h2><a class="anchor" aria-hidden="true" id="sử-dụng-conda"></a><a href="#sử-dụng-conda" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Sử dụng Conda</h2>
<p>Conda là gói quản lý chương trình cho Python, CPP và các phần mềm khác.</p>
<p>Hiện nay SINGA có gói conda packages dùng cho Linux và MacOSX.
<a href="https://conda.io/miniconda.html">Miniconda3</a> được khuyến khích dùng với SINGA.
Sau khi cài đặt miniconda, thực hiện các lệnh sau để cài đặt
SINGA.</p>
<ol>
<li>Cho CPU
<a href="https://colab.research.google.com/drive/1Ntkhi-Z6XTR8WYPXiLwujHd2dOm0772V?usp=sharing"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Mở trên Colab"></a></li>
</ol>
<pre><code class="hljs css language-shell"><span class="hljs-meta">$</span><span class="bash"> conda install -c nusdbsystem -c conda-forge singa-cpu</span>
</code></pre>
<ol start="2">
<li>GPU với CUDA và cuDNN (yêu cầu CUDA driver &gt;=384.81)
<a href="https://colab.research.google.com/drive/1do_TLJe18IthLOnBOsHCEe-FFPGk1sPJ?usp=sharing"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Mở trên Colab"></a></li>
</ol>
<pre><code class="hljs css language-shell"><span class="hljs-meta">$</span><span class="bash"> conda install -c nusdbsystem -c conda-forge singa-gpu</span>
</code></pre>
<ol start="3">
<li>Cài đặt SINGA với phiên bản cụ thể. Câu lệnh sau cho danh sách tất cả gói chương trình SINGA đang hoạt động.</li>
</ol>
<pre><code class="hljs css language-shell"><span class="hljs-meta">$</span><span class="bash"> conda search -c nusdbsystem singa</span>
Loading channels: done
<span class="hljs-meta">#</span><span class="bash"> Name Version Build Channel</span>
singa 3.1.0.rc2 cpu_py36 nusdbsystem
singa 3.1.0.rc2 cudnn7.6.5_cuda10.2_py36 nusdbsystem
singa 3.1.0.rc2 cudnn7.6.5_cuda10.2_py37 nusdbsystem
</code></pre>
<!--- > Lưu ý rằng việc sử dụng nightly built images không được khuyến khích ngoại trừ trong quá trình phát triển và kiểm định. Khuyến khích việc sử dụng phiên bản phát hành ổn định. -->
<p>Dùng câu lệnh sau để cài đặt một phiên bản SINGA cụ thể,</p>
<pre><code class="hljs css language-shell"><span class="hljs-meta">$</span><span class="bash"> conda install -c nusdbsystem -c conda-forge singa=X.Y.Z=cpu_py36</span>
</code></pre>
<p>Nếu không có lỗi khi chạy</p>
<pre><code class="hljs css language-shell"><span class="hljs-meta">$</span><span class="bash"> python -c <span class="hljs-string">"from singa import tensor"</span></span>
</code></pre>
<p>thì bạn đã cài đặt SINGA thành công.</p>
<h2><a class="anchor" aria-hidden="true" id="sử-dụng-pip"></a><a href="#sử-dụng-pip" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Sử dụng Pip</h2>
<ol>
<li>Cho CPU
<a href="https://colab.research.google.com/drive/17RA056Brwk0vBQTFaZ-l9EbqwADO0NA9?usp=sharing"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Mở trên Colab"></a></li>
</ol>
<pre><code class="hljs css language-bash">pip install singa -f http://singa.apache.org/docs/next/wheel-cpu.html --trusted-host singa.apache.org
</code></pre>
<p>Bạn có thể cài đặt một phiên bản SINGA cụ thể sử dụng <code>singa==&lt;version&gt;</code>, thay thông tin
<code>&lt;version&gt;</code>, v.d, <code>3.1.0</code>. Xem danh sách các phiên bản SINGA đang hoạt động ở đường dẫn.</p>
<p>Để cài đặt phiên bản phát triển mới nhất, thay đường dẫn bằng
<a href="http://singa.apache.org/docs/next/wheel-cpu-dev.html">http://singa.apache.org/docs/next/wheel-cpu-dev.html</a></p>
<ol start="2">
<li>GPU với CUDA và cuDNN
<a href="https://colab.research.google.com/drive/1W30IPCqj5fG8ADAQsFqclaCLyIclVcJL?usp=sharing"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Mở trên Colab"></a></li>
</ol>
<pre><code class="hljs css language-bash">pip install singa -f http://singa.apache.org/docs/next/wheel-gpu.html --trusted-host singa.apache.org
</code></pre>
<p>Bạn có thể thiết lập phiên bản SINGA và CUDA, như
<code>singa==3.1.0+cuda10.2</code>. Danh sách tổ hợp phiên bản SINGA với CUDA được cung cấp trong đường dẫn.</p>
<p>Để cài đặt phiên bản phát triển mới nhất, thay đường dẫn bằng
<a href="http://singa.apache.org/docs/next/wheel-gpu-dev.html">http://singa.apache.org/docs/next/wheel-gpu-dev.html</a></p>
<p>Lưu ý: phiên bản Python của Python environment trong máy của bạn sẽ được sử dụng để tìm gói wheel tương ứng. Ví dụ, nếu bạn sử dụng Python 3.6, thì gói wheel kết cấu trong Python 3.6 sẽ được pip chọn để cài đặt.
Thực tế, tên của tệp tin wheel bao gồm phiên bản SINGA, phiên bản CUDA và Python. Vì thế, <code>pip</code> biết tệp tin wheel nào để tải và cài đặt.</p>
<p>Tham khảo chú thích ở phần đầu của tệp tin <code>setup.py</code> về cách tạo các gói
wheel packages.</p>
<h2><a class="anchor" aria-hidden="true" id="sử-dụng-docker"></a><a href="#sử-dụng-docker" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Sử dụng Docker</h2>
<p>Cài đặt Docker vào máy chủ local theo
<a href="https://docs.docker.com/install/">hướng dẫn</a>. Thêm người dùng vào
<a href="https://docs.docker.com/install/linux/linux-postinstall/">nhóm docker</a> để chạy câu lệnh docker mà không cần dùng <code>sudo</code>.</p>
<ol>
<li>Cho CPU.</li>
</ol>
<pre><code class="hljs css language-shell"><span class="hljs-meta">$</span><span class="bash"> docker run -it apache/singa:X.Y.Z-cpu-ubuntu16.04 /bin/bash</span>
</code></pre>
<ol start="2">
<li>Với GPU. Cài đặt
<a href="https://github.com/NVIDIA/nvidia-docker">Nvidia-Docker</a> sau khi cài
Docker.</li>
</ol>
<pre><code class="hljs css language-shell"><span class="hljs-meta">$</span><span class="bash"> nvidia-docker run -it apache/singa:X.Y.Z-cuda9.0-cudnn7.4.2-ubuntu16.04 /bin/bash</span>
</code></pre>
<ol start="3">
<li>Xem danh sách toàn bộ SINGA Docker images (tags), tại
<a href="https://hub.docker.com/r/apache/singa/">trang web docker hub</a>. Với mỗi docker
image, tag được đặt tên theo</li>
</ol>
<pre><code class="hljs css language-shell">version-(cpu|gpu)[-devel]
</code></pre>
<table>
<thead>
<tr><th>Tag</th><th>Mô tả</th><th>Ví dụ giá trị</th></tr>
</thead>
<tbody>
<tr><td><code>phiên bản</code></td><td>phiên bản SINGA</td><td>'2.0.0-rc0', '2.0.0', '1.2.0'</td></tr>
<tr><td><code>cpu</code></td><td>image không thể sử dụng cho GPUs</td><td>'cpu'</td></tr>
<tr><td><code>gpu</code></td><td>image có thể sử dụng cho Nvidia GPUs</td><td>'gpu', or 'cudax.x-cudnnx.x' e.g., 'cuda10.0-cudnn7.3'</td></tr>
<tr><td><code>devel</code></td><td>chỉ số phát triển</td><td>nếu không có, gói SINGA Python package chỉ được cài đặt cho runtime; nếu có, environment cũng được tạo ra, bạn có thể kết cấu lại SINGA từ nguồn tại '/root/singa'</td></tr>
<tr><td><code>OS</code></td><td>cho biết phiên bản OS</td><td>'ubuntu16.04', 'ubuntu18.04'</td></tr>
</tbody>
</table>
<h2><a class="anchor" aria-hidden="true" id="từ-nguồn"></a><a href="#từ-nguồn" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Từ nguồn</h2>
<p>Bạn có thể <a href="/docs/3.1.0_Viet/build">tạo và cài đặt SINGA</a> từ mã code nguồn sử dụng các công cụ tạo chương trình hoặc conda-build, trên hệ điều hành máy chủ cục bộ (local host os) hay trong Docker container.</p>
<h2><a class="anchor" aria-hidden="true" id="câu-hỏi-thường-gặp"></a><a href="#câu-hỏi-thường-gặp" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Câu Hỏi Thường Gặp</h2>
<ul>
<li><p>Q: Lỗi khi chạy <code>from singa import tensor</code></p>
<p>A: Kiểm tra chi tiết lỗi từ</p>
<pre><code class="hljs css language-shell">python -c "from singa import _singa_wrap"
<span class="hljs-meta">#</span><span class="bash"> tới thưu mục chứa _singa_wrap.so</span>
ldd path to _singa_wrap.so
python
<span class="hljs-meta">&gt;</span><span class="bash">&gt; import importlib</span>
<span class="hljs-meta">&gt;</span><span class="bash">&gt; importlib.import_module(<span class="hljs-string">'_singa_wrap'</span>)</span>
</code></pre>
<p>Thư mục chứa <code>_singa_wrap.so</code> thường ở
<code>~/miniconda3/lib/python3.7/site-packages/singa</code>. Thông thường, lỗi này được gây ra bởi sự không tương thích hoặc thiếu các thư viện dependent libraries, v.d cuDNN hay
protobuf. Cách giải quyết là tạo một virtual environment mới và cài đặt SINGA trong environment đó, v.d,</p>
<pre><code class="hljs css language-shell">conda create -n singa
conda activate singa
conda install -c nusdbsystem -c conda-forge singa-cpu
</code></pre></li>
<li><p>Q: Khi sử dụng virtual environment, mỗi khi tôi cài SINGA, numpy cũng tự động bị cài lại. Tuy nhiên, numpy không được sử dụng khi chạy <code>import numpy</code></p>
<p>A: Lỗi này có thể do biến <code>PYTHONPATH</code> environment lẽ ra phải để trống trong khi bạn sử dụng virtual environment để tránh mâu thuẫn với đường dẫn của virtual environment.</p></li>
<li><p>Q: Khi chạy SINGA trên Mac OS X, tôi gặp lỗi &quot;Fatal Python error:
PyThreadState_Get: no current thread Abort trap: 6&quot;</p>
<p>A: Lỗi này thường xảy ra khi bạn có nhiều phiên bản Python trong hệ thống, v.d, bản của OS và bản được cài bởi Homebrew.
Bản Python dùng cho SINGA phải giống với bản Python interpreter. Bạn có thể kiểm tra interpreter của mình bằng <code>which python</code> và kiểm tra bản Python dùng cho SINGA
qua <code>otool -L &lt;path to _singa_wrap.so&gt;</code>. Vấn đề này được giải quyết nếu
SINGA được cài qua conda.</p></li>
</ul>
</span></div></article></div><div class="docs-prevnext"><a class="docs-next button" href="/docs/3.1.0_Viet/software-stack"><span>Software Stack</span><span class="arrow-next"></span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#sử-dụng-conda">Sử dụng Conda</a></li><li><a href="#sử-dụng-pip">Sử dụng Pip</a></li><li><a href="#sử-dụng-docker">Sử dụng Docker</a></li><li><a href="#từ-nguồn">Từ nguồn</a></li><li><a href="#câu-hỏi-thường-gặp">Câu Hỏi Thường Gặp</a></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/singa-logo-square.png" alt="Apache SINGA" width="66" height="58"/></a><div><h5>Docs</h5><a href="/docs/installation">Getting Started</a><a href="/docs/device">Guides</a><a href="/en/https://apache-singa.readthedocs.io/en/latest/">API Reference</a><a href="/docs/examples">Examples</a><a href="/docs/download-singa">Development</a></div><div><h5>Community</h5><a href="/en/users.html">User Showcase</a><a href="/docs/history-singa">SINGA History</a><a href="/docs/team-list">SINGA Team</a><a href="/blog">SINGA News</a><a href="https://github.com/apache/singa">GitHub</a><div class="social"><a class="github-button" href="https://github.com/apache/singa" data-count-href="/apache/singa/stargazers" data-show-count="true" data-count-aria-label="# stargazers on GitHub" aria-label="Star this project on GitHub">apache/singa-doc</a></div><div class="social"><a href="https://twitter.com/ApacheSINGA" class="twitter-follow-button">Follow @ApacheSINGA</a></div></div><div><h5>Apache Software Foundation</h5><a href="https://apache.org/" target="_blank" rel="noreferrer noopener">Foundation</a><a href="http://www.apache.org/licenses/" target="_blank" rel="noreferrer noopener">License</a><a href="http://www.apache.org/foundation/sponsorship.html" target="_blank" rel="noreferrer noopener">Sponsorship</a><a href="http://www.apache.org/foundation/thanks.html" target="_blank" rel="noreferrer noopener">Thanks</a><a href="http://www.apache.org/events/current-event" target="_blank" rel="noreferrer noopener">Events</a><a href="http://www.apache.org/security/" target="_blank" rel="noreferrer noopener">Security</a></div></section><div style="width:100%;text-align:center"><a href="https://apache.org/" target="_blank" rel="noreferrer noopener" class="ApacheOpenSource"><img src="/img/asf_logo_wide.svg" alt="Apache Open Source"/></a><section class="copyright" style="max-width:60%;margin:0 auto">Copyright © 2021
The Apache Software Foundation. All rights reserved.
Apache SINGA, Apache, the Apache feather logo, and
the Apache SINGA project logos are trademarks of The
Apache Software Foundation. All other marks mentioned
may be trademarks or registered trademarks of their
respective owners.</section></div></footer></div><script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.js"></script><script>window.twttr=(function(d,s, id){var js,fjs=d.getElementsByTagName(s)[0],t=window.twttr||{};if(d.getElementById(id))return t;js=d.createElement(s);js.id=id;js.src='https://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js, fjs);t._e = [];t.ready = function(f) {t._e.push(f);};return t;}(document, 'script', 'twitter-wjs'));</script><script>
document.addEventListener('keyup', function(e) {
if (e.target !== document.body) {
return;
}
// keyCode for '/' (slash)
if (e.keyCode === 191) {
const search = document.getElementById('search_input_react');
search && search.focus();
}
});
</script><script>
var search = docsearch({
apiKey: '45202133606c0b5fa6d21cddc4725dd8',
indexName: 'apache_singa',
inputSelector: '#search_input_react',
algoliaOptions: {"facetFilters":["language:en","version:3.0.0"]}
});
</script></body></html>