
Python
美好环环相扣
困难都只是暂时的,冲鸭!
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Python-深度学习
对应的代码import torchfrom torch import nnfrom torch.nn import Sequential, Conv2d, MaxPool2d, Linear, Flattenclass Tudui(nn.Module): def __init__(self): super(Tudui, self).__init__() self.model = Sequential( Conv2d(3, 32, 5,.原创 2021-09-22 18:40:22 · 106 阅读 · 0 评论 -
Python学习-Day4
writer = SummaryWriter(“logs”)image_path = “train/bees_image/2227611847_ec72d40403.jpg”img_PIL = Image.open(image_path)img_array = np.array(img_PIL)print(type(img_array))print(img_array.shape)writer.add_image(“test”, img_array, 1, dataformats=“HWC”)原创 2021-09-21 16:12:13 · 87 阅读 · 0 评论 -
Python学习-day2
函数有多个返回值时 返回结果为元组,没有返回值就return省略print(‘hello’, end=’\t’)print(‘goood’)使用*argc表示参数个数不确定 ** 表示结果是字典 可变位置参数只能是1个局部变量加上globle就是全局变量...原创 2021-09-21 16:10:47 · 80 阅读 · 0 评论 -
Python学习记录-day1
将数据输入到文件中fp = open(“E:/tet.doc”, ‘a+’)print(‘hello测试’, file=fp)fp.close()变量定义name = ‘测试’name2 = 90 # 变量多次赋值print(name)from decimal import Decimaln1 = 1.1n2 = 2.2print(n1 + n2) # 注意精度区别print(Decimal(‘1.1’) + Decimal(‘2.2’))将str转换int 时 必须为数字串原创 2021-09-21 16:09:34 · 159 阅读 · 0 评论