์ˆ˜์„ ํ™”

[ROS2/Dashing][VMware] DQN Machine Learning ๋ณธ๋ฌธ

๐Ÿง Ubuntu/ROS2

[ROS2/Dashing][VMware] DQN Machine Learning

re.aom 2023. 11. 22. 05:49


๊ธฐ์กด์— ์‚ฌ์šฉํ•˜๋˜ Jetson Nano๊ฐ€ Ubuntu18.04๋งŒ์„ ์ง€์›ํ–ˆ์–ด์„œ Dashing ๋ฒ„์ „์„ ๋ฐ˜ ๊ฐ•์ œ๋กœ ์‚ฌ์šฉํ–ˆ์—ˆ์ง€๋งŒ
๊ณ ์žฅ ์ดํ›„์—๋„ ๊ฐ€์ƒ ๋จธ์‹ ์€ ๋Š˜ Dashing ๋ฒ„์ „์„ ์ด์šฉํ•ด์™”๋‹ค.

์ด์œ ๋Š” ์ด ๋จธ์‹  ๋Ÿฌ๋‹์„ ๊ผญ ํ•™์Šต ํ•ด ๋ณด๊ณ  ์‹ถ์—ˆ๋‹ค..

 

 

์ ฏ์Šจ๋‚˜๋…ธ ๊ณ ์žฅ ์ดํ›„์— ๋ฒ„์ถ”์–ผ๋ฐ•์Šค๋ฅผ ์‚ฌ์šฉํ•ด์™”๋Š”๋ฐ,
๋จธ์‹ ๋Ÿฌ๋‹์— ํ•„์š”ํ•œ ํ…์„œํ”Œ๋กœ์šฐ๊ฐ€ ๋Œ์•„๊ฐ€์ง€ ์•Š์•˜๋‹ค..

core dumped ์—๋Ÿฌ๊ฐ€ ๋œจ๊ณ  ํŒŒ์ด์ฌ์ด ์ข…๋ฃŒ๊ฐ€ ๋๋Š”๋ฐ, VMware๋กœ ๋ฐ”๊พธ๋‹ˆ cpu๋กœ ๋ฌธ์ œ ์—†์ด ํ…์„œํ”Œ๋กœ์šฐ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์—ˆ๋‹ค.

GPU๋กœ ๋Œ๋ฆฌ๋Š”๊ฑด ์•„์ง ์‹คํ–‰ํ•ด๋ณด์ง€์•Š์•„์„œ ์ด๊ฑด ๋ชจ๋ฅด๊ฒ ๋‹ค.

 

 

 

ROBOTIS e-Manual

 

emanual.robotis.com


์–ธ์ œ๋‚˜ ๊ทธ๋ ‡๋“ฏ ๊ณต์‹ ์‚ฌ์ดํŠธ

 

 

 

tensorflow ์„ค์น˜ (CPU)


pip ๊ฐ€ ์„ค์น˜๋˜์ง€ ์•Š์•˜๋‹ค๋ฉด pip๋„ ์„ค์น˜.

pip, pip3๋„ ๋ชจ๋‘ upgrade ํ›„ ์„ค์น˜ ์ง„ํ–‰ํ•ด์•ผ ์—๋Ÿฌ๊ฐ€ ๋œจ์ง€ ์•Š๋Š”๋‹ค.

 

$ pip3 install -U rosinstall msgpack empy defusedxml netifaces

 

$ pip3 install -U tensorflow

 

๊ทผ๋ฐ, ์—ฌ๊ธฐ์„œ ์ด ๋ช…๋ น์–ด๋ฅผ ์‚ฌ์šฉํ•œ๋‹ค๋ฉด ์•„๋งˆ tensorflow 2.x ๋ฒ„์ „์ด ์„ค์น˜๋  ๊ฒƒ์ด๋‹ค.

 

์ด ๊ฒฝ์šฐ์— ๋จธ์‹ ๋Ÿฌ๋‹ ํŒจํ‚ค์ง€ ์‹คํ–‰์‹œ keras ๋ฒ„์ „ํ•˜๊ณ  tensorflow ๋ฒ„์ „ํ•˜๊ณ  ๋งž์ง€ ์•Š์•„์„œ
import keras๋กœ ์„ ์–ธ๋œ ๋ถ€๋ถ„์„ import tensorflow as keras๋กœ ์ˆ˜์ •ํ•ด์ค˜์•ผํ•˜๋Š” ๋ฒˆ๊ฑฐ๋กœ์›€์ด ์žˆ๋‹ค.

 

$ pip3 install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.8.0-cp27-none-linux_x86_64.whl

๊ทธ๋Ÿฐ๋ฐ ๊ณต์‹ ๋ฌธ์„œ์— GPU ์„ค์น˜ ๋ช…๋ น์–ด ๋ถ€๋ถ„์„ ๋ณด๋ฉด tensorflow๊ฐ€ 1.8.0์œผ๋กœ ์„ค์ •๋˜์–ด ์žˆ๋Š” ๊ฒƒ์„ ๋ณผ ์ˆ˜ ์žˆ๋‹ค.

 

$ pip3 install -U tensorflow==1.8.0


CPU๋„ 1.8.0์œผ๋กœ ์„ค์ •ํ•ด์„œ ๋‹ค์šด๋ฐ›์•„์ฃผ๋ฉด ๋œ๋‹ค.

 

$ pip3 install keras==2.1.5

 

 

$ cd ~/robotis_ws/src/
$ git clone -b ros2 https://github.com/ROBOTIS-GIT/turtlebot3_machine_learning.git
$ cd ~/robotis_ws && colcon build --symlink-install


์ดํ›„ git clone์œผ๋กœ ๋‹ค์šด ๋ฐ›๊ณ  ๋นŒ๋“œ ํ•ด์ฃผ๋ฉด ๋˜๋Š”๋ฐ, ๋‚˜๋Š” ๊ณ„์† ๋นŒ๋“œ๊ฐ€ ๋ณต๋ถˆ๋ณต์ด์—ˆ๋‹ค.

ํŒจํ‚ค์ง€ ์„ค์น˜๊ฐ€ ๋๋‹ค๊ฐ€ ์•ˆ๋๋‹ค๊ฐ€..

 

๋งŒ์•ฝ ํŒŒ์ด์ฌ ์—๋Ÿฌ๊ฐ€ ๋‚  ๊ฒฝ์šฐ,

$ sudo apt-get install python3-dev
$ sudo apt-get install python-dev

์•„๋งˆ ์ด๊ฑฐ ์„ค์น˜ํ•˜๊ณ  ํŒจํ‚ค์ง€ ์žฌ๋นŒ๋“œ ํ•˜๋ฉด ๋ ๊ฑฐ๋‹ค.

 

 

 

 

 

์„ฑ๊ณต ~

 

 

 

Comments