Speech recognition for Pepper - pepper

I'm having trouble adding speech recognition on Pepper:
[ERROR] behavior.box :_safeCallOfUserMethod:125 _Behavior__lastUploadedChoregrapheBehaviorMasterProgram879924904:/Speech Reco._2: Traceback (most recent call last): File "/opt/aldebaran/lib/python2.7/site-packages/albehavior.py", line 115, in _safeCallOfUserMethod func() File "", line 55, in onInput_onStart RuntimeError: ALSpeechRecognition::setVocabulary NuanceContext::addContext A grammar named "modifiable_grammar" already exists.
This error keeps popping up, but I don't know why. I cannot find "modifiable_grammar" anywhere in the project.

We had the same problem and it took a lot of time to find the solution.
Use the pepper web-interface to change the robot language to another an then change to robot language again to the previous one.

Related

AWS Sagemaker Error for Training job - Algorithm Error

I am receiving the following error when I try and train an XGBoost model and have no idea how to fix it. Any help please?
UnexpectedStatusException: Error for Training job sagemaker-xgboost-2022-08-22-21-37-39-774: Failed. Reason: AlgorithmError: framework error:
Traceback (most recent call last):
File "/miniconda3/lib/python3.6/site-packages/sagemaker_containers/_trainer.py", line 84, in train
entrypoint()
File "/miniconda3/lib/python3.6/site-packages/sagemaker_xgboost_container/training.py", line 94, in main
train(framework.training_env())
File "/miniconda3/lib/python3.6/site-packages/sagemaker_xgboost_container/training.py", line 90, in train
run_algorithm_mode()
File "/miniconda3/lib/python3.6/site-packages/sagemaker_xgboost_container/training.py", line 68, in run_algorithm_mode
checkpoint_config=checkpoint_config
File "/miniconda3/lib/python3.6/site-packages/sagemaker_xgboost_container/algorithm_mode/train.py", line 110, in sagemaker_train
validated_train_config = hyperparameters.validate(train_config)
File "/miniconda3/lib/python3.6/site-packages/sagemaker_algorithm_toolkit/hyperparameter_validation.py", line 270, in validate
raise exc.UserError("Missing required hyperparameter: {}".format(hp)
My full notebook is too large to post here, but below I have also added an image of the code right before the training
SageMaker's implementation of XGBoost requires one hyperparameter, all other parameters are optional, looks like you are not passing the required parameter, num_round.
Try adding this to your dictionary:
hyperparameters = {
"num_round": 10
}
Per AWS docs, num_round: The number of rounds to run the training. Valid values: integer
For more information on SageMaker's hyperparameters requirements refer to: SageMaker Dev Guide: XGBoost Hyperparameters

Unable to add new datastreams to some specific objects in Fedora repository (Fedora commons)

I need help in resolving this issue. I am unable to add new datastreams to a few specific objects in the Fedora repository but have no clue what's really wrong about this objects. Here is the error trace I get:
HTTP code=500, Reason=Internal Server Error, body=javax.ws.rs.WebApplicationException: org.fcrepo.server.errors.ObjectNotFoundException: Error creating replication job: The requested object doesn't exist in the registry.
Traceback (most recent call last):
File "/opt/2.0/flx/pylons/flx/compress_upload_images.py", line 159, in run
obj.addDataStream(cDSName, fc.getDSXml(r.type.name), label=label, mimeType=h.safe_decode('%s' % mimeType), controlGroup=controlGroup, logMessage=h.safe_decode('Storing compressed %s' % r.type.name))
File "/usr/local/lib/python2.6/dist-packages/fcrepo/object.py", line 64, in addDataStream
self.client.addDatastream(self.pid, dsid, body, **params)
File "/usr/local/lib/python2.6/dist-packages/fcrepo/client.py", line 119, in addDatastream
response = request.submit(body, **params)
File "/usr/local/lib/python2.6/dist-packages/fcrepo/wadl.py", line 81, in submit
method=self.method.name)
File "/usr/local/lib/python2.6/dist-packages/fcrepo/connection.py", line 80, in open
return check_response_status(self.conn.getresponse())
File "/usr/local/lib/python2.6/dist-packages/fcrepo/connection.py", line 107, in check_response_status
raise ex
FedoraConnectionException: HTTP code=500, Reason=Internal Server Error, body=javax.ws.rs.WebApplicationException: org.fcrepo.server.errors.ObjectNotFoundException: Error creating replication job: The requested object doesn't exist in the registry.
Finally I was able to fix this issue. The problem was basically the database used by the Fedora Commons was inconsistent and for the image objects that I was facing the issue, entries were not present in the db. The inconsistency had happened due to some migration that happened and some rows were missed. We had to copy the missing data from the old database to the new one and it worked this time!

Name 'ftplib' is not defined?

Hey guys I've been cleaning up my old code, and I somehow have problems with declaration of ftplib in except block.
Traceback (most recent call last):
File "PiFtp2.py", line 57, in <module>
except ftplib.all_errors:
NameError: name 'ftplib' is not defined
Here is the Code (the entire code because I have no idea where the problem is):
Link to GitHub
PS: I'd appreciate if someone could tell me how to show code properly on stackoverflow as well :)
In the beginning of the file you imported only the ftp function from ftplib.
Instead of
from ftplib import FTP
use
import ftplib
and then change all FTP function calls from FTP(...) to ftplib.FTP(...) (line 51)

xlwings Workbook() call returns AttributeError: Open.Application

Hope you can help me out, first question I ask myself but I am always impressed by the professional answers I find here!
I am using xlwings to both read and write data from .xls files. I am not a seasoned programmer, and I make mistakes. From time to time, this means rebooting processes, Python and what-not.
Every now and again, I would get the following AttributeError upon calling Workbook(). The real problem is not that I don't have a clue what is happening (I tried reading the modules the error diagnostics reference to, but they are written on a level of Python that is beyond my skills), but that restarting and even rebooting(!) my laptop don't (always) solve the problem.
I wish I could give some clues as to what is happening, but it appears to be a randomly occurring problem and right now, three reboots and several restarts didn't fix it. Google can't help either. I must have run my program a hundred times by now and it wasn't always a problem! The error message, upon simply calling Workbook():
wb = Workbook()
Traceback (most recent call last):
File "<ipython-input-22-4a3c36eb9bf9>", line 1, in <module>
wb = Workbook()
File "C:\Program Files\Anaconda\lib\site-packages\xlwings\main.py", line 141, in __init__
self.xl_app, self.xl_workbook = xlplatform.new_workbook()
File "C:\Program Files\Anaconda\lib\site-packages\xlwings\_xlwindows.py", line 104, in new_workbook
xl_app = _get_latest_app()
File "C:\Program Files\Anaconda\lib\site-packages\xlwings\_xlwindows.py", line 88, in _get_latest_app
return xl_workbook_current.Application
File "C:\Program Files\Anaconda\lib\site-packages\win32com\client\dynamic.py", line 522, in __getattr__
raise AttributeError("%s.%s" % (self._username_, attr))
AttributeError: Open.Application
And as a follow up, the piece of code from 'dyamic.py' raising the error:
[...]
# If we are still here, and have a retEntry, get the OLE item
if not retEntry is None:
invoke_type = _GetDescInvokeType(retEntry, pythoncom.INVOKE_PROPERTYGET)
debug_attr_print("Getting property Id 0x%x from OLE object" % retEntry.dispid)
try:
ret = self._oleobj_.Invoke(retEntry.dispid,0,invoke_type,1)
except pythoncom.com_error, details:
if details.hresult in ERRORS_BAD_CONTEXT:
# May be a method.
self._olerepr_.mapFuncs[attr] = retEntry
return self._make_method_(attr)
raise
debug_attr_print("OLE returned ", ret)
return self._get_good_object_(ret)
# no where else to look.
raise AttributeError("%s.%s" % (self._username_, attr))
As I mentioned before, the last bit it too much for me :P
I guessed some lingering Excel.exe (or similar) process was interfering with the script after I closed some random window due to some random error, but I cant find one in the task manager. Also, this is the kind of thing a reboot should fix, right?! I also upgraded to xlwings .34 (latest version, as of now).
Windows 8.1 64 bit, Python 2.7 (Anaconda distribution, Spyder IDE), Excel 2013.
Any help is very much appreciated, of course!
Thanks a lot, kind regards,
Gordon.
EDIT:
Following advice given in the comments, I can now report that even at times when wb = Workbook() fails, from win32com.client import dynamic followed by dynamic.Dispatch('Excel.Application') returns <COMObject Excel.Application>.
Hope it helps!
Always check either any issues to open the excel sheet, such as password protected/Licensed issues..
If there is any pop up coming while opening excel, you may get the same error.

definition of qwtplot

it's my first post, hope to not break something :).
On windows there are two versions of python2.7, 32 bit and 64 bit both with pyqt and qwt5
i'm trying pyqt from some week, today i tried to use my python/pyqt/pyqwt code written on linux, on windows, but the prompt says:
C:\Users\bomba\Desktop\conversione_python\guibms>python-32 interfaccia_mark3.2.p
y
Traceback (most recent call last):
File "interfaccia_mark3.2.py", line 14, in <module>
from PyQt4.Qwt5.qplt import *
File "C:\Python27-32bit\lib\site-packages\PyQt4\Qwt5\qplt.py", line 95, in <mo
dule>
Y1 = Left = QwtPlot.yLeft
NameError: name 'QwtPlot' is not defined
someone could explain me this?
I would really apppreciate
You haven't defined the Qwtplot object.
Try using:
import PyQt4.Qwt5 as Qwt
plot = Qwt.QwtPlot()
and then use the plot object as you wish.