Reference
https://conda.io/projects/conda/en/latest/commands.html
sip2@sip2-2021:~$ source ~/anaconda3/etc/profile.d/conda.sh
sip2@sip2-2021:~$ conda info --e
# conda environments:
#
base * /home/sip2/anaconda3
py38-test /home/sip2/anaconda3/envs/py38-test
py38-torch1-12-1 /home/sip2/anaconda3/envs/py38-torch1-12-1
sip2@sip2-2021:~$ conda create -n py38-torch1-12-1-gpu-od --clone py38-torch1-12-1
Source: /home/sip2/anaconda3/envs/py38-torch1-12-1
Destination: /home/sip2/anaconda3/envs/py38-torch1-12-1-gpu-od
sip2@sip2-2021:~$ conda activate py38-torch1-12-1-gpu-od
sip2@sip2-2021:~$ mkdir -p ~/catkin_od/src
sip2@sip2-2021:~$ cd catkin_od
sip2@sip2-2021:~/catkin_od$ catkin_make
...
-- Configuring done
-- Generating done
-- Build files have been written to: /home/sip2/catkin_od/build
####
#### Running command: "make -j16 -l16" in "/home/sip2/catkin_od/build"
####
(py38-torch1-12-1-gpu-od) sip2@sip2-2021:~/catkin_od$ cd src/object_detection/scripts/yolov5/
(py38-torch1-12-1-gpu-od) sip2@sip2-2021:~/catkin_od/src/object_detection/scripts/yolov5$ pip install -r requirements.txt
(py38-torch1-12-1-gpu-od) sip2@sip2-2021:~/catkin_od$ source devel/setup.bash
(py38-torch1-12-1-gpu-od) sip2@sip2-2021:~/catkin_od$ rosrun object_detection ros_yolov5_multiple.py
Traceback (most recent call last):
File "/home/sip2/catkin_od/src/object_detection/scripts/yolov5/ros_yolov5_multiple.py", line 4, in <module>
import rospy
File "/opt/ros/noetic/lib/python3/dist-packages/rospy/__init__.py", line 49, in <module>
from .client import spin, myargv, init_node, \
File "/opt/ros/noetic/lib/python3/dist-packages/rospy/client.py", line 52, in <module>
import roslib
File "/opt/ros/noetic/lib/python3/dist-packages/roslib/__init__.py", line 50, in <module>
from roslib.launcher import load_manifest # noqa: F401
File "/opt/ros/noetic/lib/python3/dist-packages/roslib/launcher.py", line 42, in <module>
import rospkg
ModuleNotFoundError: No module named 'rospkg'
(py38-torch1-12-1-gpu-od) sip2@sip2-2021:~/catkin_od$ pip install rospkg
Collecting rospkg
Downloading rospkg-1.4.0-py3-none-any.whl (36 kB)
Collecting distro>=1.4.0
Downloading distro-1.7.0-py3-none-any.whl (20 kB)
Collecting catkin-pkg
Downloading catkin_pkg-0.5.2-py3-none-any.whl (76 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 76.1/76.1 kB 2.2 MB/s eta 0:00:00
Requirement already satisfied: PyYAML in /home/sip2/anaconda3/envs/py38-torch1-12-1-gpu-od/lib/python3.8/site-packages (from rospkg) (6.0)
Requirement already satisfied: python-dateutil in /home/sip2/anaconda3/envs/py38-torch1-12-1-gpu-od/lib/python3.8/site-packages (from catkin-pkg->rospkg) (2.8.2)
Collecting docutils
Downloading docutils-0.19-py3-none-any.whl (570 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 570.5/570.5 kB 9.0 MB/s eta 0:00:00
Requirement already satisfied: setuptools in /home/sip2/anaconda3/envs/py38-torch1-12-1-gpu-od/lib/python3.8/site-packages (from catkin-pkg->rospkg) (63.4.1)
Requirement already satisfied: pyparsing in /home/sip2/anaconda3/envs/py38-torch1-12-1-gpu-od/lib/python3.8/site-packages (from catkin-pkg->rospkg) (3.0.9)
Requirement already satisfied: six>=1.5 in /home/sip2/anaconda3/envs/py38-torch1-12-1-gpu-od/lib/python3.8/site-packages (from python-dateutil->catkin-pkg->rospkg) (1.16.0)
Installing collected packages: docutils, distro, catkin-pkg, rospkg
Successfully installed catkin-pkg-0.5.2 distro-1.7.0 docutils-0.19 rospkg-1.4.0
(py38-torch1-12-1-gpu-od) sip2@sip2-2021:~/catkin_od$ rosrun object_detection ros_yolov5_multiple.py
Traceback (most recent call last):
File "/home/sip2/catkin_od/src/object_detection/scripts/yolov5/ros_yolov5_multiple.py", line 26, in <module>
import skimage
ModuleNotFoundError: No module named 'skimage'
(py38-torch1-12-1-gpu-od) sip2@sip2-2021:~/catkin_od$ pip install scikit-image
(py38-torch1-12-1-gpu-od) sip2@sip2-2021:~/catkin_od$ rosrun object_detection ros_yolov5_multiple.py
File "/home/sip2/anaconda3/envs/py38-torch1-12-1-gpu-od/lib/python3.8/site-packages/torch/nn/modules/upsampling.py", line 154, in forward
recompute_scale_factor=self.recompute_scale_factor)
File "/home/sip2/anaconda3/envs/py38-torch1-12-1-gpu-od/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1207, in __getattr__
raise AttributeError("'{}' object has no attribute '{}'".format(
AttributeError: 'Upsample' object has no attribute 'recompute_scale_factor'
"/home/sip2/anaconda3/envs/py38-torch1-12-1-gpu-od/lib/python3.8/site-packages/torch/nn/modules/upsampling.py"
before
after
Test result
コメント
コメントを投稿