pytorch 主动释放推理过程中的显存 pytorch节省显存_unity


pytorch节省显存

Our final move into the new house is this weekend. We did a three phase, three week move. First week - anything small not nailed down. Second week, medium-sized stuff...basically everything except a week's food. Third week, all furniture. This has allowed me to keep working and 9-month pregnant Wife to be relatively relaxed about the whole process.

我们最后进入新房子的时间是这个周末。 我们进行了三个阶段,三个星期的迁移。 第一周-没有钉住的小东西。 第二周,中等大小的东西……除了一周的食物外,基本上所有东西。 第三周,所有家具。 这使我得以继续工作,并使9个月的怀孕妻子在整个过程中相对放松。

Aside: If you're moving to Portland, or want to rent a house, let me know! I'll put a Craigslist listing up soon.

旁:如果您要搬到波特兰,或想租房,请告诉我! 我会尽快列出Craigslist。

The new house is larger to accommodate a family of four as well as a guest room for overseas relatives and my home office. The builder put in incandescent lights in all fixtures, which was a bummer. I spent a few hours last weekend replacing all the lights with Compact Fluorescent (CFL) Lights.

新房子较大,可以容纳一个四口之家,还为海外亲戚和我的家庭办公室提供客房。 建造者在所有灯具中都放了白炽灯,真是太可惜了。 上周末我花了几个小时用紧凑型荧光灯(CFL)替换了所有灯。

There are usually three kinds/colors of these lights...it all depends on what their view of "white" is. We got natural-light (more blue-colored) full spectrum compact fluorescent to minimize that "office look." These are very natural-colored and produce a clean, crisp white that isn't depressing.

这些灯通常有三种/颜色...这全都取决于他们对“白色”的看法。 我们获得了自然光(更蓝色)的全光谱紧凑型荧光灯,以最大程度地减少“办公室外观”。 这些是非常自然的颜色,并产生干净,酥脆的白色,且不会令人沮丧。

The total bill to replace every single light in the house was $205 from Home Depot. I saved up a bunch of coupons and waited for a 2 for 1 sale on some of these lights. Why spend so much on new lighting? Here's why, using a custom spreadsheet with some formulas from this very good article on lighting:

从家得宝(Home Depot)更换房子中每盏灯的总费用为205美元。 我保存了一堆优惠券,并在其中一些灯上等待以2比1出售。 为什么要在新照明上花那么多钱? 这就是为什么使用自定义电子表格以及此很好的有关照明的文章中的一些公式的原因:

This spreadsheet shows EVERY light in the house that was replaced (all of them). There's "can lighting" in the ceiling in many cases, as well as closet lights, etc. This spreadsheet was originally aggressive, assuming each light was on 8 hours a day (usually from about 4pm to about midnight) when more realistically less than one half of them is on. Ideally each light would have a separate "hours on" number, so I put that they were all on 4 hours a day, which is more representative when averaged across all lights, but you get the idea and you're welcome to mess with the numbers.

此电子表格显示了被替换房屋中的所有光线(所有光线)。 在许多情况下,天花板上还有“照明灯”,以及壁橱灯等。此电子表格最初是具有侵略性的,假设每盏灯每天工作8小时(通常从下午4点到午夜),而实际上少于一天其中一半打开。 理想情况下,每盏灯应有一个单独的“小时数”,因此我将它们每天都设置为4小时,这在所有灯的平均值上都更具代表性,但您可以理解,也欢迎您将其弄乱。数字。

(Yes, I realize that this table doesn't wrap well...sorry)

(是的,我意识到这张桌子的包装不好...对不起)

Location

#

LightHrs

OldW

Total

kW

Cost/Day

Cost/Mo

Cost/Year

NewW

Total 

kW

Cost/Day

Cost/Mo

Cost/Year

Savings

Downstairs

27

108

60

6480

6.48

 $       0.97

 $29.16

 $349.92

13

1404

1.40

 $       0.21

 $6.32

 $75.82

 $274.10

Kitchen

7

28

150

4200

4.2

 $       0.63

 $18.90

 $226.80

23

644

0.64

 $       0.10

 $2.90

 $34.78

 $192.02

Office

4

16

100

1600

1.6

 $       0.24

 $7.20

 $86.40

16

256

0.26

 $       0.04

 $1.15

 $13.82

 $72.58

Upstairs

18

72

60

4320

4.32

 $       0.65

 $19.44

 $233.28

13

936

0.94

 $       0.14

 $4.21

 $50.54

 $182.74

Outside

5

20

75

1500

1.5

 $       0.23

 $6.75

 $81.00

16

320

0.32

 $       0.05

 $1.44

 $17.28

 $63.72

Misc

6

24

60

1440

1.44

 $       0.22

 $6.48

 $77.76

13

312

0.312

 $       0.05

 $1.40

 $16.85

 $60.91

Total

67

268

505

19540

19.54

 $       2.93

 $87.93

 $1,055.16

94

3872

3.87

 $       0.58

 $17.42

 $209.09

 $846.07

位置


LightHrs

旧版


千瓦

费用/天

成本/月

费用/年

新世界

总 

千瓦

费用/天

成本/月

费用/年

积蓄

楼下

27

108

60

6480

6.48

 $       0.97

 $ 29.16

 $ 349.92

13

1404

1.40

 $       0.21

 $ 6.32

 $ 75.82

 $ 274.10

厨房

7

28

150

4200

4.2

 $       0.63

 $ 18.90

 $ 226.80

23

644

0.64

 $       0.10

 $ 2.90

 $ 34.78

 $ 192.02

办公室

4

16

100

1600

1.6

 $       0.24

 $ 7.20

 $ 86.40

16

256

0.26

 $       0.04

 $ 1.15

 $ 13.82

 $ 72.58

楼上

18岁

72

60

4320

4.32

 $       0.65

 $ 19.44

 $ 233.28

13

936

0.94

 $       0.14

 $ 4.21

 $ 50.54

 $ 182.74


5

20

75

1500

1.5

 $       0.23

 $ 6.75

 $ 81.00

16

320

0.32

 $       0.05

 $ 1.44

 $ 17.28

 $ 63.72

杂项

6

24

60

1440

1.44

 $       0.22

 $ 6.48

 $ 77.76

13

312

0.312

 $       0.05

 $ 1.40

 $ 16.85

 $ 60.91


67

268

505

19540

19.54

 $       2.93

 $ 87.93

 $ 1,055.16

94

3872

3.87

 $       0.58

 $ 17.42

 $ 209.09

 $ 846.07

It's not a very controversial spreadsheet. Certainly when you replace a 120W light bulb with a 23W one and start adding multipliers like hours*lights*etc, you will save money. The only question left is when will you break even on the initial capital expenditure?

这不是一个很有争议的电子表格。 当然,当您用23W的灯泡替换120W的灯泡并开始添加乘数,例如小时*电灯*等时,您会省钱。 剩下的唯一问题是,您何时会在初始资本支出上实现收支平衡?

For us, our outlay was $200 and we'll recoup that easily within a quarter to half-year. That will multiple again, as in my personal experience CFIs will last 3-6 years. After almost exactly 5 years we just had 3 of 6 CFL lights in our kitchen all die within a week of each other. That's a lifetime of about 10,000 hours for me compared to a 1,000 hours for a standard light. My outlay of $200 will last ~5 years and I avoid replacing every light in the house at least 5, if not 10, times in that 5 year period.

对于我们来说,我们的支出是200美元,我们会在四分之一到半年内轻松收回这笔款项。 根据我的个人经验,CFI将持续3到6年,这将再次增加。 经过将近5年的时间,我们厨房中只有6个CFL灯中有3个在彼此相隔一周之内就死了。 对我而言,这是一万小时的使用寿命,而标准灯则为一千小时。 我的200美元支出将持续约5年,在此5年内,我要避免更换房屋中的每盏灯至少5次(如果不是10次)。

We've kept the old bulbs and will either give them to relatives or save them for a rainy day. Unfortunately this builder wouldn't omit the bulbs which seemed a silly thoughtless thing to me.

我们保留了旧灯泡,或将其送给亲戚或将其保存以备不时之需。 不幸的是,这位建造者不会忽略灯泡,这对我来说似乎是一件愚蠢的,没思想的事情。

翻译自: https://www.hanselman.com/blog/saving-money-on-lighting-the-new-house

pytorch节省显存