Notifications
Clear all

Need help with my addiction!

63 Posts
8 Users
20 Likes
13.7 K Views
byron
(@byron)
No Title
Joined: 5 years ago
Posts: 1122
 

@robo-pi

The info I linked to made it look quite simple to get speech recognition working with python, so much that I had it earmarked as something I would play around with, though not in so much depth as you are looking to do.  However right now its like 'I've been busy finding things not to do' as I'll not be playing with anything much for while and Spring is just around the corner which means a bunch of things to do around the grounds.   Any details you give on your progress on this will be welcome, and logged to join a growing list of electronic stuff for when I get going again. 😀 


   
ReplyQuote
Robo Pi
(@robo-pi)
Robotics Engineer
Joined: 5 years ago
Posts: 1669
Topic starter  
Posted by: @byron

Spring is just around the corner which means a bunch of things to do around the grounds.

Same here.  I have a ton of work to do around here and would probably be better off if I quit playing with robotics entirely.  But I can't help myself.   No discipline. 🤣 

Posted by: @byron

Any details you give on your progress on this will be welcome, and logged to join a growing list of electronic stuff for when I get going again. 😀 

I'm staring to make videos on things I'm doing.  I'm planning on making a video on my Semantic AI project.   And it will indeed be a series of videos that starts from the ground up.  So it will be easy to follow and isn't likely to actually touch on the Semantic AI aspects until quite far into the series.  Because before we can do Semantic AI we need to get the Speech Engine architecture in order which requires learning all about how the speech recognition engine works and how it relates to the text-to-speech engine, and how that alone is only the beginning of a complex semantic system of vocabulary, definitions, meanings, and far more importantly, how to get the robot to manage and build its own semantic system.    Because if we construct the entire system by hand that's basically nothing more than sophisticated canned chatbot.  So the robot needs to be able to build its own semantic system.  In short, the robot needs to be able to learn in a similar fashion to how we humans learn new words, ideas, and concepts. 

So there's a lot to it.  It would be a never-ending series of progress vlog videos.   Not something you could explain how to do in a single video.  At least not in detail.  I do hope to begin the series with an abstract overview of how the entire system will be constructed.  But then moving on to actually constructing that system will be an ongoing engineering project.

You mentioned before the idea of having an entire team.  Well, I'm going to be making everything I do available to everyone else and I will consider it to be "Open Source".   So hopefully others will contribute their ideas as well.  That would be great! 

I bought this Raspberry Pi specifically for this project.   For those who fear that this may be a limited processing power, not to worry.  It will be more than enough to get started with.  And if they reach a point where they find they need more processing power that's not a problem.  Just move it over to a more powerful machine.  It's that simple.   Nothing will be lost.   And besides, it's my position that if they actually find that they need more processing power they will have made some serious progress toward the project.  UNLESS, the reason they need more processing power is simply because they want to throw a set of encyclopedias at it. 

But my goal is not to get it to know a lot of stuff.  My goal is to get it to understand simple things.  Once the program can begin to understand things it can then learn more on its own.   And throwing an encyclopedia at it wouldn't be much different from throwing an encyclopedia at a 2 year-old and expecting them to become as educated as a Ph.D. in a couple days.   That's probably not a realistic expectation.  Certainly not for a human child.  A computer could probably do better, but it's still going to need to actually "learn" about everything.  Just taking in gobs of data is not the same as learning.

Anyway, that's my rant for this morning. 😎 

The immediate goal is to just set up the Speech Engines.   So that will be square one.  Getting that all squared away to where I'm really happy with the system will probably take me several weeks, or months.  And like you, that's because I simply can't devote 8 hour days to this project.   It's just a hobby that gets a few hours devoted to it once in a while intermittently.   If I could work on this full time with a team of programmers working with me we could certainly make far faster progress.

In fact, if anyone follows what I'm doing they may very well be able to run with it far beyond where I can take it simple due to the fact that they may have more time and energy to devote to it.   So there may very well become a time when I'll be left in the dust on my own project. 😮 

In fact, that's pretty much guaranteed to be the case. I'll end up just planting a seed and then sitting back and watching it grow far beyond anything I could ever do on my own.   But planting this seed is something I would really like to do.  So that's the plan.  Videos will be coming eventually, assuming a live long enough to make them. 👍 

DroneBot Workshop Robotics Engineer
James


   
ReplyQuote
Robo Pi
(@robo-pi)
Robotics Engineer
Joined: 5 years ago
Posts: 1669
Topic starter  

The Raspberry Pi Came Today!

I assembled the heatsinks, the clear plastic case with fan, and installed the NOOBS card.   Then I connected it all up to a nice "21" HDMI monitor, a keyboard, and mouse.   It fired right up with no problems.  That's always a nice. 😊 

I'm currently having it install Raspian with Desktop and suggested additional software.  Apparently that's going to take while with my slow Internet connection.  So I'll be going to bed soon and just let that install overnight.   I don't think this is the Pies' fault.  I just have a really slow Internet connection.

Tomorrow I'll look into setting up the necessary software to work with it.   I'll have to set up at least all of the following:

  1. A screen capture program for making instructional videos.
  2. Choose which Python IDE I want to use and make sure it has all the tools I'll need.
  3. I'll probably also install Jupyter Notebook on it as well as that always comes in handy.
  4. Finally I have to install and set up the TTS (Text-to-Speech), in my case pyttsx3
  5. And then the SRE (Speech Recognition Engine), in my case pocketsphinx

I'm pretty sure that LibreOffice will be installed with this Raspian so I'll have that for keeping good notes on the project as well.

This should be the total software packages I'll need for this Semantic AI project.   All I'm going to use this for is to develop the Semantic AI.

Since I'll be writing this all in Python I'm thinking that I'll probably make use of Numpy and Matplotlib.  I'll use Numpy to build association matrices for the grammar and semantic dictionaries.   And I'll use Matplotlib just as a visual tool to plot out what those association matrices look like visually.

I expect to use a lot of the techniques that are often used in visual recognition, but instead of recognizing visual patterns I'll be looking at grammar and semantic dictionary patterns.  I also expect that, as this grows, there will be a need for additional matrices for associating ideas and contextual concepts.  Of course, that higher level association will come later.

In any case, I'm getting way ahead of myself here.  Since this will all be done in Python it won't be dependent upon the Raspberry Pi at all.  In other words, at any moment I can always just copy the Python program over to a Jetson Nano and see how it performs over there.   So there's really nothing special about a Raspberry Pi here.   I just decided to try a Pie for fun and see how it works for this dedicated project.

I go to bed now.  We'll see if this thing has the full Raspbian OS on it by tomorrow.  I suspect that it should.  I started this install no more than an hour ago at most and it's 37% done.  But I'm too tired to wait any longer. 

So goodnight and sweet dreams. 🥂 

DroneBot Workshop Robotics Engineer
James


   
ReplyQuote
Robo Pi
(@robo-pi)
Robotics Engineer
Joined: 5 years ago
Posts: 1669
Topic starter  

So far everything is working out really well.  The OS loaded with no problems and is all set up.

I tried out both Geany and Thonny, and they both appear to be working just fine with both Numpy and Matplotlib already installed with the original OS.  So I didn't need to do any additional tweaking there.

I am having a slight problem with installing Jupyter Notebook.  I got it installed and the notebook itself is running, but it isn't excuting the Python code, so I'll need to get that sorted.  I like to use Jupyter Notebook when brainstorming various ideas.   It's a nice quick way to flush out various algorithmic structures.

Later tonight I'll install Vokoscreen for making instructional videos.   And then I'll move on to installing the TTS and SRE.  Maybe even making a video on those installations and set up.   Because those will be the foundation upon which this entire Semantic AI will be built.   I also realized that there is no TRE (Text Recognition Engine).   That may seem unnecessary as it normally would be unnecessary in normal robotic speech applications.  But in this Semantics AI project being able to recognize the meanings of words is paramount.  So part of this project will be to design and write our own TRE in Python.

Anyway, this project is heading down the runway ready for lift off.  Soon we'll be in the air.  Destination: Semantic AI. 🥂 

DroneBot Workshop Robotics Engineer
James


   
ReplyQuote
Robo Pi
(@robo-pi)
Robotics Engineer
Joined: 5 years ago
Posts: 1669
Topic starter  

Extreme Frustration and Total Disaster!

Yesterday things were looking pretty good and appeared to be going along fairly well.  But today things are going terribly wrong and I feel like I'm losing ground instead of gaining ground.

It began with the installation of Jupyter Notebook.   The notebook seemed to install okay, but I haven't been able to get it to execute python code.   It can't seem to find the python kernel.

So I moved on to installing pyttsx3.  I thought I'd start off with the Text-to-Speech engine and set up the voice.  But after I installed it both Geany and Thonny reported that they cannot find the module when I use the import statement.   Then I also noticed that I lost matplotlib too!  That was working earlier but now they report that they cannot find the matplotlib module.  So I'm backsliding.

Today I tried to reinstall Python and it took most of the day to do that.  Well, I did this in between raking leaves in the yard.  In any case, after doing a major reinstall of Python I'm still just as bad off as before. Jupyter Notebook still can't find python, and I still can't access either matplotlip or pyttsx3. 

Had everything gone smoothly yesterday I would have been programming some speech synthesis today.  But as it is right now I can't even import pyttsx3. 

I'm about ready to give up on Raspbian and maybe try installing Ubuntu on this Pi.   I have Ubuntu running on both my nanos and it's running flawlessly on them.   Maybe I should have purchased another Jetson Nano instead of this Raspberry Pi 4?

I was hoping to start organizing my Semantic AI architecture.   But thus far I'm too busy fighting with Raspbian.  I can't seem to get Python to run correctly here.

Anyone have Python3, Jupyter Notebook, Numpy, and Matplotlib running on Raspbian on a Pi 4?

If so, can you share the secrets?

This is disgusting when I end up spending weeks just trying to get the dag blasted tools up and running correctly.

I just ordered some new SD cards.  When they come in I'm going to burn Ubuntu onto one of them and see if I can run Ubuntu on this Pi.

They have Ubuntu for Pi 4 download here

I'll probably grab version 18.04 since that's the version I'm running on the Jetson Nanos.

I hope I can get this all sorted pretty soon.  I'd like to move on with building up a foundation for Semantic AI.

I can't really say that Raspbian is at fault here?  But I can't seem to get matplotlib and pyttsx3 to import.  They seem to have installed, but when I go to import them I get an error that the IDE can't find them.  For some reason I can import numpy without any errors.  But not matplotlib and pyttsx3.  Also Jupyter Notebook can't seem to find the Python3 kernel either.

If I had to make a review right now between a Raspberry Pi 4 and a Jetson Nano I don't think there would be any contest.  I had no major problems with the Jetson Nanos.   But then again, I'm running Ubuntu on them so may be it has more to do with Raspbian?

Anyway, I think I'll take a break and go play some jazz for a while. 😎 

DroneBot Workshop Robotics Engineer
James


   
ReplyQuote
(@pugwash)
Sorcerers' Apprentice
Joined: 5 years ago
Posts: 923
 

@robo-pi

I don't know whether this will help, but it sounds to me like a PATH problem.

Raspian, I gather, is just another UNIX clone and has a file that stores the PATH variable, you cannot alter this manually. Well, you can but it won't have any effect.

To add to the PATH variable you have to add a line that looks something like this:

export PATH="path to program:$PATH"

Or a two-liner that looks something like this:

PATH="path to program:${PATH}"
export PATH

I had problems last year trying to install mathplotlib, the problem turned out to be that the installer program was out of date but solved it finally by running the following in the command line:

curl https://bootstrap.pypa.io/get-pip.py | python3

After running the command above installation of modules started to work again as normal.

Best of luck!!


   
ReplyQuote
Robo Pi
(@robo-pi)
Robotics Engineer
Joined: 5 years ago
Posts: 1669
Topic starter  
Posted by: @pugwash

I don't know whether this will help, but it sounds to me like a PATH problem.

That's what I was thinking.  But I wasn't sure how to modify the path.  I actually started searching on that and then decided to just move over to Ubuntu anyway.

Now I'm having a problem with Ubuntu! 

I installed Ubuntu onto the Pi 4 but it just comes up with a command prompt only.  No desktop.  Well that's fine and dandy except I can't install anything on it because there's no internet connection.  So I've been studying using Google searches to figure out how to set up the WiFi from the command prompt, but nothing I've found has helped.  Every command I try isn't recognized.   Or it tells me that I need to install something first.  The problem is that I can't install anything on it until I get the Internet connection. 

They actually suggested to use sudo apt-get install xubuntu-desktop.  The only problem is that I can't install the desktop until I resolve the Internet connection first.   I even tried using a direct ethernet connection.  But so far nothing I've tried has worked.

The only thing I know to say is that the Jetson Nano was much easier to get up and running.   It even asked to set up the WiFi during the install process.  But this Raspberry Pi version of Ubuntu didn't have much of a set up routine.  All it did was demand a password and that was it.  Then it just sits there with the command line that can't even seem to recognize very man commands.

I had no idea it was going to be this nasty or I would  have just bought a third Jetson Nano instead.  I think the Jetson Nano is a more powerful SBC anyway.

I'm sure I'll get this Raspberry Pi set up eventually.  But this is going to be another one of those week-long struggles just to get the system set up so I can use it.   I might go back to the Raspbian.  At least I have a desktop there.   It's probably just a path problem as you have suggested.

I'll get it eventually.  In the meantime it's almost 6:00 AM here and I'm just now going to bed because I stayed up all night trying to set up Ubuntu with no luck!

So I'm going to bed now.  I'll take a look at this tomorrow with a fresh start.

I should have just bought another Jetson Nano for this project.   Live and learn from constant mistakes.   The Ubuntu that's on the Jetson Nano works pretty darn good.

I sort these problems out tomorrow.  Hopefully.

DroneBot Workshop Robotics Engineer
James


   
ReplyQuote
(@pugwash)
Sorcerers' Apprentice
Joined: 5 years ago
Posts: 923
 

@robo-pi

At the risk of being accused of trying to teach my "Grandma how to suck eggs" 🤣 

You can find the absolute path to files with these commands

which python3.5

or

which python3.6

 


   
ReplyQuote
byron
(@byron)
No Title
Joined: 5 years ago
Posts: 1122
 
Posted by: @robo-pi

Anyone have Python3, Jupyter Notebook, Numpy, and Matplotlib running on Raspbian on a Pi 4?

Well I was intrigued to see this so I installed Jupyter into a virtual env and Nope it would not connect.  A brief google showed various folks had problems mainly on Windows PC's I think variously around using the Chrome browser and some issued around Jupyter and Ipython.   Anyway I had no time to dig any more, but thought I would quickly also install Numpy as surely that would work.  Nope it did not.  However I did come across a solution, for me anyway, and that was I had to - sudo apt-get install libatlas-base-dev - and that got Numpy working.

I always use a python virtual environment when trying out new stuff so my my python is not effected and also running 'python' in this env does not try to bring up any other python version that that for which the virtual env was created.  My tests was done on an RPI running python 3.7 and Raspian.

I expect Mr Robo is familiar but in case anyone is not familiar with using the python virtual environment I give a quick note:

1. Create a directory to hold the virtual environment.  In my case I hold all my virtual environments in a directory imaginatively called Vpython in my home directory, and I created a sub directory to be a new virtual environment called Robo

2. Create a virtual environment with the following command (in this case my environment variables point python3 to my python 3.7 installation on the Rpi.

python3 -m venv ~/Vpython/Robo

3. The virtual environ is activated as follows:

source ~/Vpython/Robo/bin/activate

(So as my command promt is myPi $ the line would look as follows 

myPi $ source ~/Vpython/Robo/bin/activate  )

You will then see the command prompt has changed to 

(Robo) myPi:~/Vpython/Robo $

which is a bit of a mouthful.  But then you can install what you will without fear of interfering with your main python installations or other virtual python environments.  e.g pip install Numpy and sudo apt-get install libatlas-base-dev etc.

4. to deactivate the virtual environment type 'deactivate'

So I can claim success with Numpy, but as for Jupyter I fear you will have much fun to come 😎 


   
ReplyQuote
byron
(@byron)
No Title
Joined: 5 years ago
Posts: 1122
 
Posted by: @robo-pi

I tried out both Geany and Thonny

If you want to try Visual Studio Code instead of the above then I made a note a while back of what I did to get this running on my Rpi4

1. wget https://packagecloud.io/headmelted/codebuilds/gpgkey -O - | sudo apt-key add -

2. curl -L https://raw.githubusercontent.com/headmelted/codebuilds/master/docs/installers/apt.sh | sudo bash

when the installation is finished you should see a menu item under programming of 'Code OSS(headmelted) which when clicked up comes Visual Studio Code. 😍 


   
ReplyQuote
byron
(@byron)
No Title
Joined: 5 years ago
Posts: 1122
 
Posted by: @pugwash

God this sucks so bad that I am thinking about buying a RasbPi 4,

Go for it pug old boy, you know you really want one.  


   
ReplyQuote
byron
(@byron)
No Title
Joined: 5 years ago
Posts: 1122
 
Posted by: @robo-pi

Anyone have Python3, Jupyter Notebook

Telly just repeating the corona virus stuff so I had another look at the Jupiter notebook on rpi and it boils down to the following error message 

ImportError: cannot import name 'create_prompt_application' from 'prompt_toolkit.shortcuts' (/usr/local/lib/python3.7/dist-packages/prompt_toolkit/shortcuts/__init__.py)

Sadly this same error is reported on the jupyter github issues (#5224) so it appears its to do with running the lastest versions of the various things and not a rpi issue as such.   Jupiter still runs ok on my imac but then I have not done any updating recently. 


   
ReplyQuote
Robo Pi
(@robo-pi)
Robotics Engineer
Joined: 5 years ago
Posts: 1669
Topic starter  
Posted by: @byron

Well I was intrigued to see this so I installed Jupyter into a virtual env and Nope it would not connect.  

I actually installed Jupyter Notebook onto Windows 10 machines and onto my Jetson Nanos with no problems thus far.   I just installed it and it worked without an issue.

When I installed in on the Raspberry Pi the notebook part of it worked just fine.  It loads and will allow you to create cells.   But it won't execute Python code.  It reports that it can't find the Python kernel.   So I'm not sure how to resolve that issue.  I'd like to use Jupyter Notebook because it's a nice quick way to try out new ideas and save tested code modules for future use in programs.

Posted by: @byron

I expect Mr Robo is familiar but in case anyone is not familiar with using the python virtual environment I give a quick note:

Actually I'm not familiar with using python virtual environments.   I'll definitely look into learning about that.   Up to this point I haven't had any problem with Python.

Posted by: @byron

If you want to try Visual Studio Code instead of the above then I made a note a while back of what I did to get this running on my Rpi4

I have been using Code OSS on the Jetson Nano.  I do like that IDE a lot.  I was going to try to see if it will run on Raspbian too.  But I was going to use Geany and Thonny simply because they came with the Raspbian image.  I actually like Geany, as I've used it quite a bit in the past.  But I think Code OSS will be better in the long run because of the intellisense.

Strangely today I'm not feeling well.  I'm extremely tired and exhausted.  Maybe because of having stayed up all night last night trying to get this stuff running.  I hardly did anything today due to feeling so weak.  So I'm going to go back to bed and try again tomorrow.

I'm sure I'll eventually get things sorted out.  But had things gone smoothly I'd already be working my Semantic AI system.   Unfortunately I'll most likely be looking at another week trying to sort out all these tools first.   That's typically the way things tend to go in the beginning.   I want to get all the tools in place and working well, before diving into the Semantic AI project.

 

DroneBot Workshop Robotics Engineer
James


   
ReplyQuote
(@pugwash)
Sorcerers' Apprentice
Joined: 5 years ago
Posts: 923
 
Posted by: @byron
Posted by: @pugwash

God this sucks so bad that I am thinking about buying a RasbPi 4,

Go for it pug old boy, you know you really want one.  

I don't know where I could get one at the moment even if I wanted one! With all the shops, with the exception of supermarkets, pharmacies and petrol stations, closed indefinitely and I am not sure whether the Post or Couriers are working at all!

Imagine living here in Hamburg with one of the most renowned Red Light districts in the world and all the "knocking shops" (Brit. colloquial for brothels) are closed! 😥 😪 

The RasbPi 4 is very tempting but if I really want to use a Unix clone, I could fire up one of my two MacBookPro's or two MacMini's and VirtualBox, with no danger of my better half asking "What do you need another computer for?"

And on top of that, I would have to source all the peripherals. Unlike many of you, I don't have spare HDMI flatscreen monitors littering my abode.

And I just took my 13 year-old Audi in for its two-year roadworthiness test, and I know the brakes need replacing and expect to be about €2000 poorer by this evening!

There goes all hope of a RasbPi 4!


   
ReplyQuote
byron
(@byron)
No Title
Joined: 5 years ago
Posts: 1122
 

@pugwash

Indeed, whilst we may marvel that a real cheapie Rpi can actually run as a desktop it comes up very short compared to a laptop such as a MacBookPro etc.  The only point of Rpi is to experiment with it as it connects to sensors etc  or to live in a bot and zoom about the place.  

I would point out that whilst a spare monitor and keyboard could be handy the Rpi can be set up via your mac.  Thats how I set up new Rpis, I get ssh working from the outset just by putting a file called ssh in the root directory when creating a new SD card and then using a network scanner to find the new Rpi ip address.   Then I can connect to the Rpi and get VNC fired up.  Theres also a way to get the wifi up and running on first boot so you can connect and get the rpi set up without an ethernet cable  Whilst I do have a spare monitor and keyboard I never use it.

And whilst I do have a couple of mac's, of late I have been even more enraged with Apple than Robo was with his new Rpi on a couple of occasions.  One was when an update from whatever it was to mojave really screwed up.  After some hours (yes hours) with Apple support they had to give up and I was advised to use a timemachine back up to restore. And not one of my 3 routine timemachine backups would restore the computer. The timemachine restore would start ok, but give some error message after some hours.  About 2 days was wasted on this.  Luckily I also had a Carbon Copy Cloner backup and that restored everything OK.  Another recent enragement was when I moved an email from the inbox to another mailbox and it simply disappeared.  Ok I though lets try to see if I can use timemachine to retrieve the mail.  Nope.  A bit of googling revealed that since Catalina the timemachine has a bug where it doen not backup the mailbox's correctly.   That was another morning lost! (and also an email ☹️ )  I'm now thinking why pay the mac premium when I do not have this sort of aggravation with a Windows computer.

I hope your old banger, actually the same vintage as mine (07), does not leave you so much out of pocket for a nice new Rpi, as I just know how much you want to see how to set it all up from you mac. 😎 


   
ReplyQuote
Page 3 / 5