Don't worry, be happy.

2019-04-03
TIL python list assignment does not make new list!

Well, TIL python list just store the pointer to the actually list in memory. So simple list assignment does not make new list!

1
2
3
4
5
list_a = [1,2,3,4]
list_b = list_a
list_b[2] = 10
print(list_a)
print(list_b)
Read More

2019-03-14
TIL there a 3 types of Python programmer

  1. Use 2 spaces to indent.
  2. Use 4 spaces to indent.
  3. Use Tab to indent.

And they must hate each other.

Read More

2019-03-06
I found a girl

And I think this is it, she is the one.

Read More

2019-02-27
anaconda SSL module is not available

最近需要在windows上调试一下pytorch,想着用anaconda方便一些。跟着大部分教程安装完、配置了源,但是在安装pytorch的时候一直报错:SSL module is not available。同时anaconda的python直接运行import ssl也找不到ssl模块

1
2
3
4
5
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\ProgramData\Anaconda3\lib\ssl.py", line 98, in <module>
import _ssl # if we can't import it, let the error propagate
ImportError: DLL load failed: 找不到指定的模块。

百度和Google了一圈,才发现正确答案,就是添加anaconda环境变量到windows的时候需要添加3个:

1
2
3
C:\ProgramData\Anaconda3
C:\ProgramData\Anaconda3\Scripts
C:\ProgramData\Anaconda3\Library\bin

第三个没添加就会出现这个问题。

Read More

2019-02-23
Parameter size of different network architecture in torchvision.models

There are some built in models in torchvision.models, such as vgg or resnet. The same page also record a table about the Top1 & Top5 errors of different architecture. However, the parameter size of different models is missing, so I write a program and complement the table.

Read More