0%

1
2
state_dict = {k: v for k,v in state_dict.items() if k.startswith("module.xxx.")}
state_dict = {k.partition('module.xxx.')[2]: v for k, v in state_dict.items()}

今天把json转为mat的时候,发现了np.void类型。
经查发现是一个是一个结构体转过来的。 虽然没有a.keys(),
但是直接a['key']是能用的。

网速问题, 使用内网连接或者是用快的网。

pytorch的dict每次运行结果不一样。
因为dict内部使用的是hash机制,而hash使用的是当前时间。
所以当每次运行的时候,时间就发生了变化,所以hash的值就发生了变化。

又是一年开学日,很遗憾早上没能起来。

今年开学日遇到了教师节,晚起后给初高中老师发了短信祝福。老项说,“积攒前行的力量”, 是啊。

今早没能起来,是因昨晚在看地方历史。 成也古道,败也古道。 没想到曾经参观过的bt在古代竟是繁荣之地。只记得当时在墙上看到贴着的高中
榜文,只能看到高中进士的姓,也凑不出整张榜文了。戏台不大,3米宽,屋檐龙飞凤舞,现在想来的确很是别致。除此之外,隐约记得有大学生府4个大字赫然在目。

只道是,祖德流芳众传道学,孙族挺秀士烈贤书。

下载

1
sudo apt-get install squid

安装

sudo vim /etc/squid/squid.conf

1
2
3
4
5
6
7
8
9
10
11
#允许的客户端ip
acl allcomputers src 0.0.0.0/0.0.0.0
#配置用户名密码,后面会生成passwords文件
auth_param basic program /usr/lib/squid3/basic_ncsa_auth /etc/squid3/passwords
auth_param basic realm proxy
acl authenticated proxy_auth REQUIRED
http_access allow authenticated allcomputers

#http_access deny all

http_port 8128

用户密码验证

1
2
3
4
5
6
7
8
sudo apt-get install apache2-utils

sudo htpasswd -c -d /etc/squid/passwords 自定义用户名

sudo chmod o+r /etc/squid/passwords

sudo service squid start

验证

1
tail -f /var/log/squid/access.log

使用

1
2
export http_proxy="http://用户名:密码@代理IP:代理端口"
curl -l "http://www.baidu.com"

1
2
3
4
5
6
7
8
sudo nano /etc/gai.conf
Locate #precedence ::ffff:0:0/96 100 and and remove the #.

$ sudo nano /etc/sysctl.conf
# IPv6
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1