Correcting/dumping a pickling error - pickle

I made a mistake while I was attempting to pickle a model. I used dill and had this wrong command:
with open('ml/city_model.pkl', 'rb') asfile:
Here you see no space between as and file, which is the error. However, I had deleted this line but it seems the system still remembers this command. As I attempted to submit my assignment to a remote grader, it showed
with open('ml/city_model.pkl', 'rb') asfile:
SyntaxError: invalid syntax
Could I erase this in any possible way? Thank you very much for your help.

Related

caffe could not open or find file

I'm new to caffe and after successfully running an example I'm trying to use my own data. However, when trying to either write my data into the lmdb data format or directly trying to use the solver, in both cases I get the error:
E0201 14:26:00.450629 13235 io.cpp:80] Could not open or find file ~/Documents/ChessgameCNN/input/train/731_1.bmp 731
The path is right, but it's weird that the label 731 is part of this error message. That implies that it's reading it as part of the path instead of as a label. The text file looks like this:
~/Documents/ChessgameCNN/input/train/731_1.bmp 731
Is it because the labels are too high? Or maybe because the labels don't start with 0? I've searched for this error and all I found were examples with relatively few labels, about ~1-5, but I have about 4096 classes of which I don't always actually have examples in the training data. Maybe this is a problem, too (certainly for learning, at least, but I didn't expect for it to give me an actual error message). Usually, the label does not seem to be part of this error message.
For the creation of the lmdb file, I use the create_imagenet.sh from the caffe examples. For solving, I use:
~/caffe/build/tools/caffe train --solver ~/Documents/ChessgameCNN/caffe_models/caffe_model_1/solver_1.prototxt 2>&1 | tee ~/Documents/ChessgameCNN/caffe_models/caffe_model_1/model_1_train.log
I tried different image data types, too: PNG, JPEG and BMP. So this isn't the culprit, either.
If it is really because of my choice of labels, what would be a viable workaround for this problem?
Thanks a lot for your help!
I had the same issue. Check that lines in your text file don't have spaces in the end.
I was facing a similar problem with convert_imageset. I have solved just removing the trailing spaces in the text file which contains the labels.

Why can't I get any .m file to work in octave?

I am desperately trying to run octave in a VirtualBox of Ubuntu 12.04. I have made a file called ANGRY.m which has lines as follows:
%How badly does octave suck?
OCTAVESUCKS=5
That is it. When I try to run it (i.e. enter ANGRY into the command line I get this error message:
error: `ANRGY' undefined near line 1 column 1
I've had things running better than this in octave and have absolutely no clue why it is doing this or how to fix it or how to go about trying to search for what is wrong. I am sorry I cannot be more helpful. But I really can't. Please aim any answer at a total moron. I'm really not a programmer.
You misspelled ANGRY when you put it into the terminal...
Do you see your file ANGRY.m when you type
ls
in Octave? Check the working dir with "pwd"!

windows error handling

The problem is that i'm running octave on windows or least I think that's the problem.
I'm causing an error on purpose and what I'm trying to do is get the whole error message so that I can grab the full file path from it. pwd() is returning the home directory, not the directory the program is running from.
I've tried error.file but apparently that's not part of the error struct.
so here is a full sample:
try
err = make_error();
catch
msg = lasterror.file;
print(msg);
end_try_catch
You've read the documentation wrong. The structure returned by lasterror does not have a field named file. What does have is a field named stack, which is also a struct, which does have a file field. So what you're looking for is lasterror().stack.file. See the manual section about catching error.
Also, pwd() returns the working directory, not the home directory. You are either doing something else wrong or it's a bug with the windows version.

Error: token "#" is not valid in preprocessor expressions

Can anyone tell me what would be the cause of the error
/mysql_com.h:306:5: error: token # is not valid in preprocessor expressions
while this mysql_com.h file does not contain any #. So how can I fix this error.
I think it's similar to the error when we open windows edited file in linux, then at that time ^V appers. But in this case # is not anywhere in the file.
Thanks in advance. Looking for your kind response.
Looks like this sort of problem has been reported when a '.h.in' file is included at some point, instead of the usual '.h' header file (eg. this) - perhaps because of some missing files or misconfigured include paths?
As has been previously suggested, I'd try tracing things back through the definition of MYSQL_VERSION_ID and double check that the correct .h files and include paths are present on your machine.
You have to check what is stored in MYSQL_VERSION_ID. Go to the library file, where this constant defined having the syntax like below :-
#define MYSQL_VERSION_ID BLAH-BLAH
Try to resolve this BLAH-BLAH, because this definitely have some problem, that have "#" symbol.

BiarEnginer.jar/Command Line Import Documentation/Usage

Anyone know where the documentation is for the properites file?
I am trying the following exportQuery:
select * form ci_infoobjects where si_kind like 'FavoritesFolder' and si_name like 't%'
It is correctly grabbing the users but, is not biaring any of the folders/reports that said user has.
Suggestions?
Ok here is what I have found out.
documentation: on the command line importe is in the bi_vip pdf provided by SAP (which I will provide a link to later).
usage: My query isn't exactly correct but, removing the si_name portion should get you th right result.
issues: It seems that the command line importer does not gracefully handler export errors. Any export error it receives the command line will kill itself.
work around: I am pretty much duplicating the ImportWizard in java at this using API BIAROutput and IException.
I will hopefully post back my source code for the command line import tool in java.