我正在使用 google colab 运行 python 代码并尝试缩小图像。
from keras.layers import Lambda
import tensorflow as tf
from skimage import data, io, filters
import numpy as np
from numpy import array
from numpy.random import randint
from scipy.misc import imresize
import os
import sys
import matplotlib.pyplot as plt
plt.switch_backend('agg')
# Takes list of images and provide LR images in form of numpy array
def lr_images(images_real , downscale):
images = []
for img in range(len(images_real)):
images.append(imresize(images_real[img],[images_real[img].shape[0]//downscale,images_real[img].shape[1]//downscale], interp='bicubic', mode=None))
images_lr = array(images)
return images_lr
Run Code Online (Sandbox Code Playgroud)
它应该缩小图像但显示此错误。
从 …
我正在 google colab 中运行用于深度学习的 python 代码。该代码需要 Python 3.5。如何在 google colab 中安装 Python 3.5 版本?