SageMaker - cannot import sklearn - scikit-learn

I am trying to import sklearn in SageMaker Notebook but unable to do so, getting the below error.
ModuleNotFoundError: No module named 'sagemaker.sklearn'
Is there any other SageMaker extension to be installed ?
SageMaker Code - Studio
Kernel

It seems to be the compromised image/environment.
I recommend directly using the most up-to-date image that includes python 3.10:
Data Science 3.0

Related

Warning an errors after updating to tensorflow 2.1 in AWS Deep Learning AMI

We updated from tensorflow 1.13 to 2.1 in an EC2 instances where we installed the following AMI:
https://aws.amazon.com/marketplace/pp/Amazon-Web-Services-Deep-Learning-AMI-Ubuntu-1604/B077GCH38C#pdp-reviews
The AMI was the v24 and therefore contained some packages that needed updated.
I updated the tensorflow package to the version mention before but now everytime that I load the library I get the following error:
Also it is in possible to run any of the examples available in the documentation as I am getting multiple errors.
Would someone be able to support?
You can use the latest version of the Deep Learning AMI to use TensorFlow 2.1 (release notes here: https://docs.aws.amazon.com/dlami/latest/devguide/appendix-ami-release-notes.html)

Is there any implementation of mtcnn face detection in tensorflow 2.0?

Recently I've moved to tensorflow==2.0.0-rc0 and now mtcnn for face detection is not working on my computer. Can I find tensorflow==2.0.0-rc0 version of mtcnn? Pure Keras implementation of mtcnn would also work in this situation.
I've tried keras implementation of facenet at https://github.com/nyoki-mtl/keras-facenet. Its nice implementation of facenet in kears but the face detection part (mtcnn in keras) is missing.
I needed TF 2 as well so just pushed up this library. You should be able to clone the repo and python setup.py install to install it. It's developed against tensorflow 2.5.0.
P.S. For those looking to port TF 1.x libraries to TF 2 in the future, this comment may be all you need!

Need to install python packages in Azure ML studio

I am new to Azure ML studio and trying to run python script.
Currently I am working on Text analytics related code and as part of that I want to get the singular values of SVD decomposition something like below
lsa=TruncatedSVD(algorithm='randomized',n_components=MaximumNumComponents,n_iter=20,random_state=42,tol=0.0)
U = lsa.fit_transform(X)
Sigma = lsa.singular_values_
Current version of scikit learn in Azure ML studio is 0.17 and singular values is part of higher versions of scikit learn like 0.20.
So I need to upgrade scikit learn package to 0.20. I tried downloading scikit learn 0.20 wheel file and zipped it and uploaded as dataset into Azure ML studio and connected enter image description here but still getting error like below "
AttributeError: 'TruncatedSVD' object has no attribute 'singular_values_'
Process returned with non-zero exit code 1
Already referred to below questions as well
Stackoverflow questions related to upgrade packages in Azure ML studio
How can I install Python packages in Azure ML?
Currently this is the limitation with Azure ML studio. The only way is to reach out to support who generates the necessary package and we can upload it to Azure ML Studio.

Connect to QOCI Linux driver in PyQT5?

When I want to connect my Linux PyQt5 project with QOCI it Shows this message:
QSqlDatabase: QOCI driver not loaded
How Can I fix It?
first look for the available drivers on your linux:
from PyQt5 import QtSql
QtSql.QSqlDatabase().drivers()
on ubuntu 16.04 with python 3.5 and pyqt5 i only get:
['QSQLITE']
in pyqt5 documentation i found:
QtSql contains classes that integrate with SQL databases. It includes editable data models for database tables that can be used with GUI classes. It also includes an implementation of SQLite.
So I suppose, there is only SQLite3 but no Oracle supported in pyqt5. Perhaps you can use python and cx_oracle instead

Installing sci-kit learn with no atlas

I am trying to install scikit-learn so that it doesn't have access to ATLAS (other BLAS and LAPACK libraries okay). Is there is a way to set the install so that ATLAS isn't used? Sorry for the basic question but I couldn't see a good way of doing it.
The reason I want to do this: I'm working on a cluster where I can't build atlas, but the pre-installed version of it is broken (compiled on 16 cores, only 8 cores on node, pthread problems), so when I install scikit-learn my scikit-learn tries to fire up these libraries and I get errors.
Thanks
EDIT: It seems I had some things wrong, and actually scipy is still broken after I compile it against openblas. In one of the unit tests I'm getting:
assertion !pthread_create(&thr->thrH, &attr, rout, arg) failed, line 111 of file /var/tmp/portage/sci-libs/atlas-3.10.1-r2/work/ATLAS//src/threads/ATL_thread_start.c
Bit of a longshot now, but any idea why my scipy build is even looking at ATLAS?
Numpy, scipy and scikit-learn will all try to link to ATLAS if they find it. While scikit-learn can build against its own embedded subset of BLAS if no ATLAS or other BLAS/LAPACK is found on the system, scipy will require a BLAS/LAPACK implementation anyway.
What you could do is build your own versions of numpy, scipy and scikit-learn against a locally built of either ATLAS or OpenBLAS (take the master branch on github for the latter).
To do so you need to customize the site.cfg file in the numpy and scipy source folders prior to building.
Also you should build OpenBLAS with something like:
make TARGET=NEHALEM NO_AFFINITY=1 NUM_THREADS=8 USE_OPENMP=0

Resources