Eruvae / yolact_ros

ROS wrapper for yolact instance segmentation
54 stars 45 forks source link

yolact edge error #17

Closed FPSychotic closed 3 years ago

FPSychotic commented 3 years ago

Hi, trying your new yolact edge support, but I'm doing something wrong, using rosrun yolact_ros yolact_edge_ros I get

File "/home/nx/yolact_ws/src/yolact_ros-master/scripts/yolact_edge_ros", line 78
    def __init__(self, net:Yolact):
                          ^

SyntaxError: invalid syntax

extra info: -I use Jetson NX, and I have OpenCV 4.1.1 compiled from souce with CUDA and cuDNN and contrib.

I think all could be due to the sudo or some change in opencv4 , but I have no idea!! XD

thank you!!!

Eruvae commented 3 years ago

If it complains about invalid syntax at that line, it means it is using python 2 (which didn't have the option to specify a type for a parameter).

You shouldn't need to run anything with sudo. Make sure the yolact_ros package is also in the python3 workspace, and source that workspace after activating your virtual environment, not your usual workspace. Also, exporting this PYTHONPATH variable might help: export PYTHONPATH="$HOME/.virtualenvs/yolact/lib/python3.6/site-packages:$PYTHONPATH" where yolact is the name of your virtual environment. If you have another workspace that is sourced in your .bashrc, it could help removing that. It can be a bit tricky to get it working.

On Ubuntu 20 / ROS noetic, it's much easier, because that uses python 3 by default (also opencv 4), so you don't need to have any separate workspace or recompile cv_bridge. If you can't switch, but you compile ROS from source anyway to use opencv 4, you could also try building it with python 3: https://www.miguelalonsojr.com/blog/robotics/ros/python3/2019/08/20/ros-melodic-python-3-build.html I haven't tried this, so no guarantee that it works.

FPSychotic commented 3 years ago

thanks by your help! I will take all this a look and if it doesn't work I will make a clean install, I dont think any of this is a problem of your software. I want help no distract, the reasonable is that. thank you so much by share!! I close all my issues. Take care