How to build a deep learning environment running Python in Docker container

How to build a deep learning environment running Python in Docker container

Check virtualization in Task Manager, if it is enabled, if it is disabled, restart the computer and enable it in Bios.

insert image description here

Install Docker Desktop and enable the WSL feature.

insert image description here

Open PowerShell

Create an image

docker run --rm -it quay.io/azavea/raster-vision:pytorch-latest /bin/bash
docker images

insert image description here

Create a container based on the image id

docker create -it --name [name] [image id]
docker start [name]

insert image description here

Entering the container

docker exec -it [container id] /bin/bash

insert image description here

Transfer files between docker container and local machine

docker cp [local path] container id:[path inside container]
docker cp D:\docker\raster-vision\myPY\test.py 7837a6060f9d:/opt/src/code/test.py
docker cp container id:[path inside container] [local path] 

insert image description here

View all docker images
View all containers docker ps -a

insert image description here

insert image description here

Expected more than 1 value per channel when training, got input size torch.Size([1, 256, 1, 1])

batch_size=1 results in
Change it to an even number or set the parameter drop_last=True in the torch.utils.data.DataLoader class or in a class you create that inherits from DataLoader to discard data that is less than one batch_size.

urllib.error.URLError: <urlopen error [Errno 111] Connection refused>

Network problem.
Download locally and then upload or use a VPN.

This is the end of this article about how to build a deep learning environment with Python using Docker containers. For more information about how to build a deep learning environment with Python using Docker containers, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • How to run Python script on Docker
  • How to create a basic image of the Python runtime environment using Docker
  • Using Docker to run a simple Python program

<<:  Div covers the flash. Flash transparent method realizes placing the DIV layer on the flash.

>>:  Implementing Priority Queue in JavaScript

Recommend

MySQL 5.7 installation and configuration tutorial under CentOS7 64 bit

Installation environment: CentOS7 64-bit MINI ver...

Detailed explanation of react setState

Table of contents Is setState synchronous or asyn...

The best solution for resetting the root password of MySQL 8.0.23

This method was edited on February 7, 2021. The v...

Seven Principles of a Skilled Designer (2): Color Usage

<br />Previous article: Seven Principles of ...

Solve the problem of Tomcat10 Catalina log garbled characters

Running environment, Idea2020 version, Tomcat10, ...

html opens a new window with a hyperlink and can control window properties

1. The window size opened by the HTML hyperlink C...

A brief discussion on the VUE uni-app life cycle

Table of contents 1. Application Lifecycle 2. Pag...

Tutorial on installing GreasyFork js script on mobile phone

Table of contents Preface 1. Iceraven Browser (Fi...

Detailed explanation of the use of $emit in Vue.js

1. Parent components can use props to pass data t...

How to create WeChat games with CocosCreator

Table of contents 1. Download WeChat developer to...

How to implement responsive layout in vue-cli

When we are doing front-end development, we will ...

ElementUI implements cascading selector

This article example shares the specific code of ...