Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues running train.py with Ubuntu 20.04 with pip #3

Closed
kinow opened this issue Oct 19, 2020 · 7 comments · Fixed by #4
Closed

Issues running train.py with Ubuntu 20.04 with pip #3

kinow opened this issue Oct 19, 2020 · 7 comments · Fixed by #4

Comments

@kinow
Copy link
Contributor

kinow commented Oct 19, 2020

Hi!

I started the tutorial with Ubuntu 18.04, but upgraded to 20.04. I had stopped just before running python train.py, so I guess it could be either the upgrade, or my previous environment was broken too?

I am using a virtual env (venv Python module), and installed with pip install -r requirements.txt. Modules list:

pip list
Package         Version
--------------- ---------
certifi         2020.6.20
cycler          0.10.0
detecto         1.1.6
future          0.18.2
kiwisolver      1.2.0
matplotlib      3.3.2
numpy           1.19.2
opencv-python   4.4.0.42
pandas          1.1.2
Pillow          7.2.0
pip             20.2.4
pyparsing       2.4.7
python-dateutil 2.8.1
pytz            2020.1
setuptools      41.2.0
six             1.15.0
torch           1.6.0
torchvision     0.7.0

Running the script, I'm getting:

ImportError: libavcodec.so.57: cannot open shared object file: No such file or directory

I found this issue jabelone/OpenCV-for-Pi#10 (comment), and installing opencv-contrib-python fixed the issue for me.

I think if I used the Conda package, it might have worked (as it would have installed the system libraries I think?). But with pip in an venv, it looks like the opencv-contrib-python works better than opencv-python (which is a transitive dependency of detecto).

Created the issue just in case anyone is aware of what I should have done differently, or if someone else has a similar issue 👍

Thanks for the code & docs!!! 🎉
Bruno

@thomasdavis
Copy link
Contributor

@kinow Thanks so much for the debugged information, I'm sure others will run into the same problem.

Let me know if everything works as intended for you? And would love to see what you are working on

@kinow
Copy link
Contributor Author

kinow commented Oct 19, 2020

It worked @thomasdavis : https://twitter.com/kinow/status/1318099405598126081

Next I will try to use it to find sea glass in images. Not too sure if that will work, but will let you know if that works 👍

@kinow
Copy link
Contributor Author

kinow commented Oct 19, 2020

Maybe we can add in the readme that error, and point to the alternative module if the error occurs? WDYT @thomasdavis ?

@thomasdavis
Copy link
Contributor

I'm a bit busy tonight but happy to merge a PR.

How did you find the tute?

I can help you with the sea glass idea too if you have any questions.

Is it for environmental reasons or something else?

@kinow
Copy link
Contributor Author

kinow commented Oct 19, 2020

I'm a bit busy tonight but happy to merge a PR.

Done #4

How did you find the tute?

So far my favorite. I never used Tensorflow, Keras, nor PyTorch. And most tutorials are long and boring :-) different than yours.

I can help you with the sea glass idea too if you have any questions.

Is it for environmental reasons or something else?

An, no special reason I guess. A friend tweeted about sea glasses.

I translated it into Portuguese (pedras do mar), and it made no sense. I read its Wikipedia, and at that moment I was working on a library for image processing.

So I thought it could be a good experiment to

  1. Use OpenCV to locate the sea glass in her pictures, as they seem to be well organized in a display for collection I think
  2. Use that image processing library (Apache Commons Imaging) to then tell what's the most prominent color in RGB
  3. Translate the color name into English (with Pantone, or some other list)

Silly experiment, but I also never used OpenCV...

And now my idea is to compare and understand whether instead of OpenCV if it would be simpler to label some images (both with that easy collectors-display stand, and random sea glass images) and create a PyTorch model.

Probably a crazy train of thought, but I find experiments that are simple, and related to things in my memory help me more to undestand/learn/remember later.

Thanks!

@thomasdavis
Copy link
Contributor

Yeah I still haven't even figured out Tensorflow lol one sweet day...

For your experiment;

  1. I think using Detecto should get you most of the way there
  2. That will probably work.
  3. I've used this site before for other things -> https://chir.ag/projects/name-that-color/#CFCCBF (essentially you give it any arbitrary hex decimal and it will give you back a nice english name for that color)

And, I'm definitely in the same boat as you, I have been trying to learn ML for years and the aboriginal flag project inspired me to do it.

And my latest one to learn text based ML was -> https://fake.jsonresume.org (https://github.com/jsonresume/jsonresume-fake)

@kinow
Copy link
Contributor Author

kinow commented Oct 19, 2020

Yeah I still haven't even figured out Tensorflow lol one sweet day...

😄 same here

For your experiment;

I think using Detecto should get you most of the way there

Perfect!

That will probably work.

🤞

I've used this site before for other things -> https://chir.ag/projects/name-that-color/#CFCCBF (essentially you give it any arbitrary hex decimal and it will give you back a nice english name for that color)

I think for a handful of images that should be fine. In case I end up running it with a lot of images, I may need to find an offline list to avoid hammering their website.

And my latest one to learn text based ML was -> https://fake.jsonresume.org (https://github.com/jsonresume/jsonresume-fake)

Never tried that! I bet if you apply with that CV it will receive a few calls from recruiters :)

The closest I've used is natural language generation for bots and weather forecast (a co-worker wrote the code, but I had to maintain it, basically a decision tree with if's and else's to choose how to generate the weather forecast in English).

There might be something more clever way (neural net as in your example?) to consume an API like weatherunderground, metservice, bom, etc, and create the forecast based on past forecast data+text script.

That would be a fun project too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants