load_balanced_view not working properly - ipython-parallel

I have some code that used to work with ipyparallel using a load_balanced_view. I used to be able to:
from ipyparallel import Client
rcAll = Client()
lbvAll = rcAll.load_balanced_view()
for anInpt in allInpt:
lbvAll.apply(doAll, anInpt)
lbvAll.wait()
lbvAll.get_result()
and then
lbvAll.results.values()
would be a list of the results
however, now lbvAll.apply() does not work for me
I can do
result = lbvAll.map_sync(doAll, allInpt)
and result is returned as a list of results.
Using 2-4 cores/engines, there is not much improvement using 4 cores over 2 cores.
My feeling is that ipyparallel has changed but I am not sure and I do not seem to using it correctly. Thanks in advance for any help.
I am using Python 3.4.5, IPython3 5.1.0 and ipyparallel 5.2.0 on linux

Related

How can I see every change a pip install makes?

I'm working on an air-gapped PC and I'd like to install xgboost so I can use it in a machine learning model. However, to do so I have to move xgboost over on a thumbdrive.
I've tried downloading it to a similar machine and transferring it over, but it seems like the python _ctypes don't get moved over, and I get the following error when I try and use XGBoost:
CDLL.__getitem__(self, name_or_ordinal)
400 def __getitem__(self, name_or_ordinal):
--> 401 func = self._FuncPtr((name_or_ordinal, self))
402 if not isinstance(name_or_ordinal, int):
403 func.__name__ = name_or_ordinal
AttributeError: function 'XGBGetLastError' not found
I don't understand Python's C based backend, so I'm not sure how to fix this without knowing exactly what changes pip made when installing xgboost.
Is there a way to see all the changes pip makes when installing a package?

My kernel keeps dying in jupyter notebook when i run fit function

My kernel keeps dying when i run fit function
my tensorflow version 2.6.0
i've reinstalled the jupyter notebook, upgraded my pip, upgraded my tensoflow library,
added this line
import os
os.environ['KMP_DUPLICATE_LIB_OK']='True'
and still my kernel keeps dying
this is the code i tried to run
learning_rate_reduction = ReduceLROnPlateau(monitor = 'val_acc', patience = 3, verbose = 1, factor = .5, min_lr = .00001)
es = EarlyStopping(monitor='val_categorical_accuracy', patience = 4)
print('====')
history = model.fit_generator(generator = train_batches, steps_per_epoch = train_batches.n//batch_size, epochs=epochs,
validation_data = val_batches, validation_steps = val_batches.n//batch_size, verbose = 0,
callbacks = [learning_rate_reduction, es])
In my experience you should try one of these
Check Environment Variables
make sure you have CUDA_PATH
make sure you write path to cuda/bin, cuda/include, cuda/lib/x64 in PATH in System Variables
Check if the model is too complex by training the network on smaller simpler model
Make sure anaconda navigator is updated
In my experience python 3.8.5 and tensorflow 2.7 works and can be downloaded in the environments in anaconda navigator
If it broke with simple model, it means you're doing something wrong with the PATH in system environment
If you're using VSCode you might have to set all the variables first before using
If you're using Anaconda you can download directly in download section
im using tensorflow 2.8 and python 3.10 and still works

Is it possible to run a Python program within a Java "GraalVM" program?

From the GraalVM examples, they have code like this to run a single line of Python code:
context.eval("python", "\nprint('Hello polyglot world Python!');");
Yes that works fine in a Java program.
I can also run a Python program from the command line using the "graalpython" program.
My question is how do I run a python program from the Java example I mentioned above?
context.eval("python", "\nprint('Hello polyglot world Python!');");
I tried using the "file:" argument, but that didn't work or I'm doing something wrong.
For example, this did not work:
context.eval("python", "file: /path_to_python/test.py");
This line of code gives me:
Original Internal Error:
java.lang.RuntimeException: not implemented
So, maybe that answers my question, but I have to believe you can run a python script from a GRAAL program like you can a single line of code. Hence, this posting.
--
Is running a python program from within a Java program using graal "eval" supported? If so, I would very much appreciate an example of usage.
Thanks very much.
You need to build a Source object in order to eval a file:
File file = new File("/path_to_python/test.py");
Source source = Source.newBuilder("python", file).build();
context.eval(source);

is that possible to do igblast(Analyze immunoglobulin (Ig) sequences) with python/biopython

I'm fresh to python/biopython and tried blast using biopython like this:
from Bio.Blast import NCBIWWW
fasta_string = open("C:\\xxxx\\xxxx\\xxxx\\abc.fasta").read()
result_handle = NCBIWWW.qblast("blastp", "nr", fasta_string)
print result_handle.read()
I was wondering if it is possible to run igblast using biopython. I have searched for this but it seems no one is really doing this.
I haven't tried them, but I have found:
pyigblast.
PyIgBlast - Open source Parser to call IgBlast and parse results for
high-throughput sequencing. Uses Python multi-processing to get around
bottlenecks of IgBlast multi-threading. Parses blast output to
deliminated files (csv,json) for uploading to databases. Can connect
directly with mysql and mongo instances to insert directly.
The code uses Python 2.7 and BioPython.
PyIR
Immunoglobulin and T-Cell receptor rearrangement software. A Python wrapper for IgBLAST that scales to allow for the parallel processing of millions of reads on shared memory computers. All output is stored in a convenient JSON format.
The code uses Python 3.6 and BioPython.
Both tools use a locally installed igblastn executable. You can install igblastn locally with conda install igblast.

Previous version of Z3 for linux

Does anyone know how we can get previous versions of z3 for linux 64? I am using Ubuntu 10.04 and it does not include GLIBGXX 3.4.14 which is required by z3 3.2 (the version I currently have). So I was wondering if I could get access to a previous version.
Also if anyone knows how can I overcome this problem (maybe a way to get GLIBCXX 3.4.14) on Ubuntu 10.04 I would appreciate the help.
Thanks
The old versions are still available on the Z3 website. However, we do not provide links to them. You can download them from
http://research.microsoft.com/en-us/um/redmond/projects/z3/
Here is the complete list:
z3-2.0.1.tar.gz
z3-2.10.tar.gz
z3-2.11.tar.gz
z3-2.12.tar.gz
z3-2.13.tar.gz
z3-2.15.tar.gz
z3-2.17.tar.gz
z3-2.18-x64.tar.gz
z3-2.18.1.tar.gz
z3-2.18.tar.gz
z3-2.19.1.tar.gz
z3-2.19.tar.gz
z3-2.2.tar.gz
z3-2.3.1.tar.gz
z3-2.3.tar.gz
z3-2.4.1.tar.gz
z3-2.4.tar.gz
z3-2.5.tar.gz
z3-2.6.tar.gz
z3-2.7.tar.gz
z3-2.8.tar.gz
z3-3.0-x64.tar.gz
z3-3.0.tar.gz
z3-3.1.tar.gz
z3-3.2.beta.tar.gz
z3-3.2.tar.gz
z3-4.0.tar.gz
z3-osx-3.2.1.tar.gz
z3-osx-3.2.tar.gz
z3-osx-4.0-preview.tar.gz
z3-osx-4.0.tar.gz
z3-osx32-4.0.tar.gz
z3-x64-2.15.tar.gz
z3-x64-2.18.tar.gz
z3-x64-2.19.tar.gz
z3-x64-3.0.tar.gz
z3-x64-3.1.tar.gz
z3-x64-3.2.beta.tar.gz
z3-x64-3.2.tar.gz
z3-x64-4.0.tar.gz
Leonardo is right, but you can't find the download link in that page.
You must use the list of programs and use something like:
http://research.microsoft.com/en-us/um/redmond/projects/z3/z3-3.2.tar.gz
. You can change the filename in bold by one in the list provided by Leonardo.

Resources