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

How to create a new user in CentOS and enable key login

Table of contents Create a new user Authorize new...

Detailed explanation of the usage of DECIMAL in MySQL data type

Detailed explanation of the usage of DECIMAL in M...

Detailed explanation of flex and position compatibility mining notes

Today I had some free time to write a website for...

Summary of new usage examples of computed in Vue3

The use of computed in vue3. Since vue3 is compat...

An example of using Lvs+Nginx cluster to build a high-concurrency architecture

Table of contents 1. Lvs Introduction 2. Lvs load...

How to use CSS to write different styles according to sub-elements

The effect we need to achieve: What is needed The...

Use of MySQL query rewrite plugin

Query Rewrite Plugin As of MySQL 5.7.6, MySQL Ser...

How to allow all hosts to access mysql

1. Change the Host field value of a record in the...

Discussion on the problem of iframe node initialization

Today I suddenly thought of reviewing the producti...

Pitfalls and solutions for upgrading MySQL 5.7.23 in CentOS 7

Preface Recently, I found a pitfall in upgrading ...

Method and introduction of table index definition in MySQL

Overview An index is a table of correspondence be...

How to install redis5.0.3 in docker

1. Pull the official 5.0.3 image [root@localhost ...

HTML Learning Notes--Detailed Explanation of HTML Syntax (Must Read)

1. What is HTML markup language? HTML is a markup...