There can be many reasons why this can happen. In my case I couldn’t locate the change that was made in WordPress that caused the issue. The only major change since the last time a post was added was a WordPress update, but that didn’t strike me as being the reason as it wasn’t a major version.
Be that as it may, what solved the issue for me was this link – to summarize, change the following lines in wp-config.php
define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] . '/');
define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST'] . '/');
of course, replace DOMAIN with the primary domain for your WordPress app.
an alternative method is here, though I haven’t tried it
when you code in many languages, you usually need to dig a bit to find answers to questions that are not immediately obvious in a specific language. Mine was whether closures can simulate real private variables in python (i.e that really can’t be accessed as opposed to the __ mangling method).
I decided to test if this would work with closures, as shown below
# real private variables and methods go here
this.a = a
this.b = b
return this.a + this.b
return this.a * this.b
def set_nums_(a, b):
this.a, this.b = a, b
# public variables and methods go here
return this.a, this.b
def set_nums(self, a, b):
and the result:
>>> x = outer(5,3)
<__main__.outer..inner object at 0x0000023C581E21C0>
Yay! seems like it works.
Of course, a bit of further digging showed that every python object has the
__closure__ property through which you can access the closure for that object, and changing the values of the “private” variables above (bypassing the set_nums method) just becomes a matter of:
>>> loophole = x.sum.__closure__.cell_contents.__closure__.cell_contents
>>> loophole.a = 8
>>> loophole.b = 9
There are so many tutorials on deep learning that it’s hard to figure out which to choose, but if you want to start your journey into the field of deep neural networks, you should definitely take a look at this unbelievable free gem:
If you prefer a good udemy course to get you started then I’d recommend:
There are various ways to leverage docker to develop AWS lambda serverless functions. One recent method is to deploy Python Lambda functions with container images (as specified here).
Another method is to develop the Lambda package from within an Amazon Linux docker container and then upload it to AWS Lambda (more details here). A summary of how to do this is described below and will work for any platform where you can install Docker.
Open a command prompt and type:
docker pull lambci/lambda
docker run -it lambci/lambda:build-python3.8 bash
This will install the environment to run Python 3.8 code and open a shell prompt so you can start working. The first thing recommended to do when getting the bash prompt is
when you exit the shell, you can always re-enter by typing:
docker start -i container_name
container_name with the container name of given to the image named
lambci/lambda:build-python3.8, which can be seen via
docker ps -a)
Wanting to run Linux command line under windows usually brings you to one of two options:
- Install WSL (Windows Subsystem for Linux) – the main advantage here is performance optimizations made by Microsoft to take the most advantage of the hardware and OS infrastructure.
- Install Docker for Windows 10 and then create a Linux container which you can run and get the command line prompt from
There are other options such as running a full graphical virtual machine like VirtualBox, VMWare and the like, but our focus will be getting a quick Linux command line prompt from Windows.
My personal preference is using option 2, mainly due to it being easy to install and the ability to easily create multiple sandboxed instances and easily use them for different purposes.
The following describes how to install the latest Ubuntu version and run it as a docker container.
- If you haven’t already done so, install Docker for Windows
- open a command prompt and type:
docker pull ubuntu
- next, type:
copy the image id of the repository named ubuntu
- suppose the image id of the repository you copied was
docker run -it --name=ubuntu-container f6a191f19b5f /bin/sh
- that’s it, you have the root prompt on the latest Ubuntu running on your Windows system!
- After you exit the ubuntu container, you can always enter it again by typing from the command prompt:
docker start -i ubuntu-container
I was curious to see how much slower the training of chapter 1 of fast.ai would be on my GPU-less home desktop vs. a basic cloud GPU servers. The first issue was to get the code running after installing torch, torchvision and fastai modules. Apparently, there are some code modifications to make to get things running on my local system – I’ve summarized them here:
from fastai.vision.all import *
# To fix: Can't get attribute 'is_cat' on <module '__main__' (built-in)>
from iscat import *
path = untar_data(URLs.PETS)/'images'
# added num_workers=0 to avoid:
# AttributeError: '_FakeLoader' object has no attribute 'noops'
dls = ImageDataLoaders.from_name_func(
path, get_image_files(path), valid_pct=0.2, seed=42,
label_func=is_cat, item_tfms=Resize(224), num_workers=0 )
learn = cnn_learner(dls, resnet34, metrics=error_rate)
And the results ?
Well, the dataset used to train the network to distinguish between cats and dogs takes a decent GPU around 20 seconds to complete for each epoch.
Giving this task to my CPU took around 40 minutes per epoch.
Now you know why a GPU is highly recommended for machine learning, at least until someone will discover a more efficient way to do it (like this?)
This was the error I received when trying to
import fastbook to study the excellent fast.ai course.
I had Python 3.9.1 installed and used pip to install the latest versions of torch, torchvision, and fastai
To spare the reader from boring war stories, here’s the bottom line:
- Download the latest version of torchvision for your platform from https://download.pytorch.org/whl/torch_stable.html
cpu/torchvision-0.8.2%2Bcpu-cp39-cp39-win_amd64.whl is torchvision 0.8.2 for cpu on Windows for version 3.9 of C Python)
pip install torchvision-0.8.2+cpu-cp39-cp39-win_amd64.whl (assuming this is the version you downloaded)
pip install fastai --upgrade
You should now be able to
Seems like a comprehensive set of algorithms in one library, based on a similar Java project: https://pypi.org/project/strsim/