Output logs from pyscipopt - scip

It may be a basic question, but how can I view the log of the solver after the model is optimized. I came across the option to hide the outputs by specifying model.hideOutput(). Is there an option to show the outputs (by default, I don't see any output log. I am using Spyder IDE).

Printing the SCIP output is activated by default in PySCIPOpt. As you already wrote, you would have to manually disable it by calling hideOutput(). Have you tried running your code in a terminal outside of Spyder? Is the model even solved, so did you check whether there is a solution in the end?

To complete the other answer: if your PySCIPOpt model has been created by third-party code, it is possible the output has been turned off upstream.
You can still call model.hideOutput(False) -- see the documentation of hideOutput().

Related

How to debug a custom loss function?

I don't have a specific problem at the moment, but it keeps coming up that I have a bug in my loss function and the error printouts are not sufficient to localize the problem to a specific line of code. For example expected 'int32' but got 'float32' or something like that. Is there a way to know which line of code in the loss function is the source of the problem?
I'll note that sometimes the error comes during compilation, in which case print statements have been helpful. But I have not identified a way to find the problem (outside of guessing or commenting out sections) if it happens only during training, since printouts are not displayed.
You can use one of following option to debug custom loss function or any other deep learning works.
tf.print
tfbdg
TensorBoard debugger

how to fix the problem of downloading fasttext-model300?

I'm using windows 10 and python 3.3. I tried to download fasttext_model300 to calculate soft cosine similarity between documents, but when I run my python file, it stops after arriving at this statement:
fasttext_model300 = api.load('fasttext-wiki-news-subwords-300')
There are no errors or not responding, It just stops without any reaction.
Does anybody know why it happens?
Thanks
I'd recommend against using the gensim api.load() functionality. It dynamically runs new, unversioned source code from remote servers – which is opaque in its operations & suboptimal for maintaining a secure local configuration, or debugging any issues which occur.
Instead, find the actual exact data files you trust and download them as plain data. Then, use specific library operations, like the KeyedVectors.load_word2vec_format() method, so instantiate exactly the model you need, using precise local-file paths you understand.
Following those steps may make it clearer what, if anything, is going wrong. If it doesn't, try also enabling logging at the INFO level to gather more information about what progress is made before failure (and add any new details as a comment or to your question).
python3 -m gensim.downloader --download fasttext-wiki-news-subwords-300
Try using this. Source : https://awesomeopensource.com/project/RaRe-Technologies/gensim-data

Can I launch Dymola without the GUI?

I've got an application that I'm working on which currently takes a model, passes it to OpenModelica, compiles it, runs a simulation, and grabs the output. We'd like to switch over to use Dymola, but I can't figure out how to do this in a GUI-less fashion.
For instance, I've seen how I can use the javascript interface by running "dymola.exe -serverport 8082", but that actually still launches a GUI, and you can see everything running in the background when you use the javascript interface. Plus, closing the GUI kills the server.
Is there any way to use Dymola without a GUI? Note also that I can't simple use the .exe of a compile model, since compiling the model is one of the things I need to do.
Even easier is if there is a way for me to run my .mos file without the GUI launching.
you can use Dymola in command line mode and passing the right optional argument to not show its GUI.
You should use the following command :
C:/Program Files (x86)/Dymola 2016 FD01/bin64/Dymola.exe /nowindow myscript.mos
With the first part being the pass the the Dymola executable depending on where it was installed on your machine, the second one /nowindow being the optional argument stating that the GUI should not be displayed, and the third part path to your Modelica script which can contained the simulation setup.
Check the Dymola User Guide for additional details.
Best regards,
Gilles
From the command line, dymola.exe -nowindow.

how to generate call graph with PC-Lint?

I'm having trouble figuring out how to generate a call graph with PC-lint.
I have tried adding the -vhm flag to pc lint but nothing happens.
Can anyone tell me how to get PC-Lint to generate the call graph?
The -vh option is used to display a graph of the "Strong Type Hierarchy" and the -vm option just prints the names of source code files as they are processed. As of the current version of PC-Lint, there is no way to cause it to display a call graph although there are plenty of other tools that can do this.

Print complete control flow through gdb including values of variables

The idea is that given a specific input to the program, somehow I want to automatically step-in through the complete program and dump its control flow along with all the data being used like classes and their variables. Is their a straightforward way to do this? Or can this be done by some scripting over gdb or does it require modification in gdb?
Ok the reason for this question is because of an idea regarding a debugging tool. What it does is this. Given two different inputs to a program, one causing an incorrect output and the other a correct one, it will tell what part of the control flow differ for them.
So What I think will be needed is a complete dump of these 2 control flows going into a diff engine. And if the two inputs are following similar control flows then their diff would (in many cases) give a good idea about why the bug exist.
This can be made into a very engaging tool with many features build on top of this.
Tell us a little more about the environment. dtrace, for example, will do a marvelous job of this in Solaris or Leopard. gprof is another possibility.
A bumpo version of this could be done with yes(1), or expect(1).
If you want to get fancy, GDB can be scripted with Python in some versions.
What you are describing sounds a bit like gdb's "tracepoint debugging".
See gdb's internal help "help tracepoint". You can also see a whitepaper
here: http://sourceware.org/gdb/talks/esc-west-1999/
Unfortunately, this functionality is not currently implemented for
native debugging, but I believe that CodeSourcery is doing some work
on it.
Check this out, unlike Coverity, Fenris is free and widly used..
How to print the next N executed lines automatically in GDB?