วิธีติดตั้ง Tensorflow บน ubuntu
Back to articles

วิธีติดตั้ง Tensorflow บน ubuntu

วิธีติดตั้ง Tensorflow บน ubuntu

Linux Updated: February 5, 2026

วิธีติดตั้ง Tensorflow บน ubuntu

  1. ติดตั้ง Python 3:

sudo apt update
sudo apt install python3 python3-pip

  1. สร้าง Virtual Environment (แนะนำ):

sudo apt install python3-venv
python3 -m venv tf_env
source tf_env/bin/activate

  1. ติดตั้ง TensorFlow ด้วย pip:

pip install --upgrade pip
pip install tensorflow

  1. ตรวจสอบการติดตั้ง:

python -c "import tensorflow as tf; print(tf.__version__)"

หลังจากติดตั้งเสร็จแล้วคุณจะสามารถใช้ TensorFlow ได้ในสภาพแวดล้อม Python ของคุณแล้ว อย่าลืมเรียกใช้ source tf_env/bin/activate เพื่อเข้าสู่ virtual environment ก่อนใช้ TensorFlow หรือเพื่อออกจาก virtual environment เมื่อเสร็จสิ้นการใช้งาน

หมายเหตุ:

  • การใช้ virtual environment ช่วยให้คุณสามารถจัดการแพคเกจ Python ของโปรเจกต์ได้แยกต่างหากจากสภาพแวดล้อมระบบปฏิบัติการ

  • คำสั่ง source tf_env/bin/activate ใช้สำหรับเปิดใช้งาน virtual environment และคำสั่ง deactivate เพื่อปิดใช้งาน virtual environment นี้

แนะนำให้ทำการอัปเดตระบบก่อนการติดตั้งแพคเกจ และอย่าลืมตรวจสอบความเข้ากันของเวอร์ชันแพคเกจ TensorFlow กับเวอร์ชัน Python และแพคเกจอื่นๆ ที่คุณใช้ด้วยกันด้วย

หากคุณต้องการการติดตั้งที่ละเอียดมากขึ้นเช่นการติดตั้ง GPU-enabled TensorFlow หรือการกำหนดเวอร์ชันเฉพาะ คุณควรดูเอกสารทางเว็บไซต์ TensorFlow สำหรับข้อมูลเพิ่มเติม: <https://www.tensorflow.org/install>

D

DriteStudio | ไดรท์สตูดิโอ

Cloud, VPS, Hosting and Colocation provider in Thailand

Operated by Craft Intertech (Thailand) Co., Ltd.

Manage your cookie settings

We use different types of cookies to optimize your experience on our website. Click on the categories below to learn more and customize your preferences. Note that blocking some types of cookies may impact your experience.

Necessary Cookies

These cookies are essential for the website to function properly. They enable basic functions like page navigation and access to secure areas.

View cookies used
  • Session cookies (session management)
  • Security cookies (CSRF protection)
Always On

Functional Cookies

These cookies enable personalized features like language preferences and theme settings. Without these, some features may not work properly.

View cookies used
  • lang (language preference)
  • theme (dark/light mode)

Analytics Cookies

These cookies help us understand how visitors interact with our website by collecting and reporting information anonymously.

View cookies used
  • _ga (Google Analytics)
  • _gid (Google Analytics)

Marketing Cookies

These cookies are used to track visitors across websites to display relevant advertisements based on your interests.

View cookies used
  • Advertising cookies
  • Remarketing pixels

Privacy Policy