How to specify version for dependencies so that each one is compatible and stays within a size limit?

I am trying to deploy a web app to Heroku. The free tier is limited to 500 MB. I am using my resnet34 model as a .pkl file. I create model with it using the fastai library. This project requires torch and torchvision as dependencies. But not specifying the dependency will download the latest version of torch which alone is 750 MB and exceeds the memory limit. So, I specify torchvision version as 0.2.2 and specify the wheel for torch …
Category: Data Science

Direct media library upload saving in wrong month date folder in custom theme

I have an issue in my custom theme. Direct media library upload saving in wrong month date folder (2017/03) when current date is 2018/09. But when I upload images through post it goes to the correct folder. I have tested in default theme, Direct media library upload goes to the correct folder. So the issue is in my custom theme. But I am not sure where to look at. In which file of my theme has the issue? Help is …
Category: Web

Which python library for supervised learning of HMMs?

I have a dataset which looks like this: timestamp sensor1 sensor2 sensor3 sensor4 sensor5 action 1 0.05 0.04 0.10 0.39 0.59 A1 2 0.25 0.14 0.11 0.34 0.59 A2 3 0.15 0.34 0.13 0.36 0.59 A3 ....... Since I have the observations (sensor1-sensor5) and the corresponding labels (A1, A2, A3, etc.) for each timestamp, I want to perform supervised learning using a hidden markov model. Which library could I use to learn the observation distribution and the parameters of the …
Category: Data Science

wordpress images not showing properly

Images are not visible properly in the media library after caching them from my other website. The featured image is also not being set. However the images are showing up on the front end of the website, and the path that it is being redirected is also correct. The images attached to the posts of the previous months are all showing up and i am able to set them as the featured image. attached are the screenshots of the media …
Category: Web

How do I use the Simple HTML DOM Parser in plugin when other plugin already uses it?

In a plugin I am currently coding, I want to use the Simple HTML DOM Parser library. However, when I include it require(CPS_PLUGIN_PATH . '/vendor/simple_html_dom.php'); I get this error: Fatal error: Cannot redeclare file_get_html() (previously declared in /www/htdocs/12345/mydomain.com/wp-content/plugins/custom-post-snippets/vendor/simple_html_dom.php:48) in /www/htdocs/12345/mydomain.com/wp-content/plugins/fast-velocity-minify/libs/simplehtmldom/simple_html_dom.php on line 54 So obviously the Fast Velocity Minify plugin is already using it. What do I do here, if I don't want to mess around in the library itself? What's the best practice in a case like this?
Category: Web

How to upload media to a specific folder without a plugin in Wordpress?

Is there anybody who knows an article that explains and shows a code about creating our own plugin for organising media library with folders in the admin? All media that I upload goes in the wp admin section Media -> Library. For example I have uploaded 100 picture and would be nice to be organised in folders. For example Animals, Flowers, ect.
Category: Web

How to professionally spell library names such as "scikit learn"?

For example for inclusion in a CV. This is mostly a question of whether one should use capital letters or not. Usually I search the library to find how the library name is spelled on the official page. For scikit-learn it is spelled without capital letter, while most of the other letter has some capital letter at the beginning (and often inside as well). Still it doesn't feel right next to other capitalised names. Should I still use a capital …
Category: Data Science

Pattern recogniser library for C# programs

I'm a regular user of the StackOverflow forum, but as this question is about a recommendation for libraries, which is supported at StackOverflow, and as my question is about data science libraries, I've decided to take my chance here (my original question has been kicked from the "Artificial Intelligence forum"). I'm developping a program that takes a table of a database and predicts the next (limited list of) tupple(s), e.g. for the following table: A B C D ================ 1 …
Category: Data Science

Allow a specific user role I have created to only upload one image to his media library

Hello guys I was following this article but the code doesn't seem to do anything. The last one by Maruti Mohanty is doing something , it doesn't allow any files to upload with an error. Set a maximum upload count for users on a specific user role As the title says, I would like to allow a specific user role I have created to only upload one image to his media library. Any ideas how to do that? Thanks John
Category: Web

How to solve incompatibility between DeepPavlov, Tensorflow and Numpy in a Python script?

I am trying to run a script in Python 3.7 that makes use of DeepPavlov and Tensorflow==2.4.1. It seems that there is an incompatibility, because: DeepPavlov can work only with Numpy==1.18 Tensorflow==2.4.1 needs at least Numpy==1.19.2 If I downgrade Tensorflow, some of the instructions in the script fail, in particular I can not import "transpose_shape". I may try to change the script, and use different functions. However, I know for sure that this script has been successfully used by the …
Category: Data Science

Add JavaScript-Library “Fitty” to WordPress

I am a beginner of Wordpress with a small programming knoledge. I managed to integrate the fitty-script succsesfully to my Wordpress installation and yes, it works. But only as long as i am logged in as admin in wordpress. Does anyone have an idea what the problem could be. Thanks in advance for your support.Please find below the code: function child_scripts() { wp_enqueue_script( 'fitty', get_theme_file_uri( '/js/fitty.min.js' ), array(), filemtime( get_theme_file_path( '/js/fitty.min.js' ) ), true ); wp_enqueue_script( 'child', get_theme_file_uri( '/js/child.js' ), …
Category: Web

anaconda change 'base' environment permanently to a different environment 'myenv' to startup at terminal openings

I would like to cahnge the 'base' install environemnt that inisiates when I start a terminal to an a diferent environment that i have created called 'myenv' anaconda evironment. I want that 'myenv' stats every thime wen I star the terinal. I have turned off the 'base' environemnt from initaiating. conda config --set auto_activate_base false I am on Ubuntu 20.04
Category: Data Science

Cuda's 'libcudaart.so' libraries cannot be loaded

I'm trying to run my tensorflow model (v2.4.1) in an AWS instance with CUDA drivers installed: nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2019 NVIDIA Corporation Built on Sun_Jul_28_19:07:16_PDT_2019 Cuda compilation tools, release 10.1, V10.1.243 Tensorflow cannot load 'libcudart.so.11.0', however: python3 -c 'import tensorflow as tf; print(tf.__version__)' 2021-04-29 07:36:15.555572: W tensorflow/stream_executor/platform/default/dso_loader.cc:60] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory 2021-04-29 07:36:15.555616: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you …
Category: Data Science

Rebuild the entire WordPress uploads folder

I have an unfortunate situation in which a client disabled "Organize my uploads into month- and year-based folders" which is what organizes files into a {year/month} folder hierarchy on the webserver. Now I have too many files in one folder for the server to handle. I'd like to move the files into folders again and update the db to point to the new file locations. Is there any way to do this (or get me a good part of the …
Category: Web

alternatives to pyspark to query a csv file locally (no distributed computation needed)

I am reading a csv file with pyspark to extract some information from it. I am running pyspark locally and I do not need distributed computation. On the contrary I need some plotting library such as matplotlib to plot data. I know there are some workarounds to do it with pyspark but I found it very complicated. My question is: is there any alternative to pyspark, possibly python-native, that allows to query a csv file allowing to use python libraries?
Category: Data Science

Open source Anomaly Detection in Python

Problem Background: I am working on a project that involves log files similar to those found in the IT monitoring space (to my best understanding of IT space). These log files are time-series data, organized into hundreds/thousands of rows of various parameters. Each parameter is numeric (float) and there is a non-trivial/non-error value for each time point. My task is to monitor said log files for anomaly detection (spikes, falls, unusual patterns with some parameters being out of sync, strange …
Category: Data Science

Unable to declare AOS library in functions

Greeting WP Devs, I am planning to transfer the script libraries in my function.php . In my function.php I registered AOS function mypage() { if ( is_page( 'mypage' ) ) { wp_register_script( 'aosjs', get_template_directory_uri() . 'js/aos.js', array( 'jquery' ), NULL, false ); wp_enqueue_script( 'aosjs' ); wp_enqueue_script( 'jquery.min' ); add_action( 'wp_enqueue_scripts', 'testingarea'); Page Name : mypage https://mysite/mypage/ - My script has cdn with AOS.init <script src="js/aos.js"></script> <script> AOS.init({ easing: 'ease-in-out-sine' }); </script> First Test- AOS is registered in functions.php aand in …
Category: Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.