Error running the tutorial example
rubenlucas93 opened this issue · comments
Hi, I already followed all the steps mentioned in the tutorial but I got the following issues:
-
When running detectionStudio with permissions granted with "sudo chmod -R 666 /opt/datasets" I got this error:
-
Once I solved this error giving permissions to all with "sudo chmod -R 777 /opt/datasets" and after configuring the folders and files as indicated I got the following error when clicking in "Select Input".
I also get this warning when launching the app. It may help:
Thanks in advance!
Hi! Thanks for the report and for using our tool!
Could you be us some more details about your deployment? Are you using Detection Studio installed fromm source code or the docker images with everything built-in?
I installed it from source code.
It may be irrelevant but when building Detection Studio I had another issue:
Detection studio was looking for the opencv2/opencv.hpp file in /usr/include folder, but when executing "sudo apt-get install python-opencv" this file was generated in /usr/include/opencv4/opencv2/opencv.hpp so I had to move it to the expected location to make it work.
When clicking Select Input, a pop up window should appear asking you to select a file from the path where you are executing the application.
I'd suggest you to check for permissions for ./DatasetEvaluationApp and the path that it access.
Could you try with sudo?
It says no module named numpy... Have you installed numpy?
I have checked and it's not in the requirements. Could be a issue.
Please check installing numpy and if you manage to run it we should add that requirement.
Hi, I tried the following:
uninstalling and installing numpy
uninstalling and installing tensorflow
uncomment some #includes in TensorFlowInferencer.h
but none of this worked.
When I import this module directly in python3 it works and, in fact, I see the module in numpy lib folder
I tried to recompile several times and I get a warning about numpy, but after googling, it should not to be a problem:
I will try to install DetectionStudio via docker now but I will probably need to work with this as developer, so if you have any suggestion or question to solve this problem I would appreciate it.
Thanks!
Regards,
Rubén.
Hi again!
Trying to install it via docker.
I ran the command indicated in the install tutorial:
docker run -dit --name detection-studio -v [local_directory]:/root/volume/ -e DISPLAY=host.docker.internal:0 jderobot/detection-studio:latest
It created a container but no gui is displayed.
I tried to start the container but it does nothing and, when I type "docker ps" I don´t see any container running.
I show below the executed commands and the result (note that the last one is just for letting you know how I installed the docker):
Thanks,
Best regards,
Rubén.
Answers for both questions:
-
The module that runs tensorflow and numpy etc is tensoflow_detect.py. That file creates the detection graph and runs inferences over the images. Could you try running isolated that file inferencing one random image to understand where the problem is coming from?
-
Could you provide logs from docker?
docker logs [container_name]
? That docker container is supposed to open a window when run. Could be something related to DISPLAY variable. It opens a qt5 window.
Dockerfile source is here if you want to take a look.
Hi again,
- I had a different problem with my environment and I had to install it all from scratch. After repeating the libraries and different tools installations, I got to reach a different error (This time DetectionStudio does not close):
I will take another look tomorrow, but today I did not get to solve it.
Thanks a lot for your support!
-
The first error says that it can't open the video file. Could you try with another video file?
-
The docker error is related with the X display. This error tells you that docker can't display the screen because it can't connect to it. You could try opening a new terminal and do:
socat TCP-LISTEN:6000,reuseaddr,fork UNIX-CLIENT:\"$DISPLAY\"
and the run the application.
Hi again!
-
I tried with 3 videos and none of them is working. However the first video should work, since I read in another issue for detection studio that one of the maintainers suggested to use exactly that one. After reinstalling opencv with ffmpeg codec enabled I get the numpy error again. I will try to solve this reinstalling the numpy module again and I will let you know.
-
Still not working
Hi again.
-
I got to see that the TensorflowInferencer.cpp didn´t get the same sys.path as the one I have in my environment.
I manually add the path '/home/rlucasz/.local/libs/python2.7/site-packages and now it found numpy. Now the problem is that it still doesn´t find some other components related to tensorflow as "tools". I will try to figure it out and let you know how it goes.
I also followed the following steps:
https://www.cerebrumedge.com/single-post/2017/12/26/compiling-opencv-with-cuda-and-ffmpeg-on-ubuntu-1604 -
Still not working
Hi!!!:
- The problem is that, when running DataEvaluationApp with sudo, the paths and permissions are different and, for whatever reason, there are some libraries not found (e.g tensorflow.python.tools or google) giving exception after exception.
Could you help me to run this without sudo??? The problem was the first reported. Do you know the paths accesed by DataEvaluationApp???
Thanks in advance.
Could you sum up the problematic and the solution, please?
It could be interesting updating the code/installation instructions with the solution if we find it necessary.
Do you feel something in the instructions is not clear enough? If so, you can open an issue and PR with the content updated.
I just let you know in here so you can update it if you consider it needed.
Finally, to install and make detectionStudio work in my Ubuntu 20.04.1 LTS, the provided manual and the following two actions are enough:
-
Install some libraries needed by opencv to work with some images and video formats:
sudo apt-get install libjpeg8-dev libtiff5-dev libjasper-dev libpng12-dev
sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
sudo apt-get install libxvidcore-dev libx264-dev -
After downloading opencv and creating the build directory inside, the cmake must be executed with the following flags:
make -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D BUILD_opencv_python2=ON -D WITH_FFMPEG=1 -D WITH_CUDA=ON -D CUDA_GENERATION=Pascal -D ENABLE_FAST_MATH=1 -D CUDA_FAST_MATH=1 -D WITH_CUBLAS=1 -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules ..
And then check that the following options are displayed as "YES":
- In my case the following patch was applied to be able to choose a video to be evaluated, but I am not sure whether this is a matter of my installed qt version or if it is actually an error.
Anyway, just in case you want to consider, I leave here the applied patch in path "DetectionStudio/DetectionStudio/DatasetEvaluationApp/mainwindow.cpp".
Note that I modified the extension so I could leave it here, but it should be mainwindow.patch
Hi @rubenlucas93, feel free to create and submit a pull-request with those improvements, regarding this issue. We will review it and eventually merge it into the master branch of the project.
Hi @rubenlucas93 , you don't need write access on the repository to create a pull-request to it. Please learn how to do it, for instance: https://gist.github.com/dlaehnemann/e6c8f46eee80112267af70ae92a3df13 and https://stackoverflow.com/questions/2916845/different-default-remote-tracking-branch-for-git-pull-and-git-push/30488025#30488025
Right!!!
Learned and done!
Thanks!
Merged! Closing the issue.
Thanks for your first contribution! 😄