使用Free-GPU accelerating 来训练深度学习模型文件 (一)

写在前面的话:qiagoogle-drive-ocamlfuse遇到的各种问题

首先介绍一下这个文件

google-drive-ocamlfuse是由OCaml编写的Google Drive支持的基于FUSE的文件系统。它可让您在Linux上安装挂载Google Drive。
该项目托管在github上,您可以在这里找到最新的开发版本。

在使用codelab时经常遇到这样的问题,即

/bin/bash: google-drive-ocamlfuse: command not found

解决办法:

用OPAM进行安装google-drive-ocamlfuse

1.安装OPAM(ubuntu系统为例子)

apt-get install opam

2.运行以及更新OPAM:

opam init
opam update

3.安装依赖项

opam install depext
opam depext google-drive-ocamlfuse

4.安装google-drive-ocamlfuse

opam install google-drive-ocamlfuse

但是安装完之后,执行一下命令

!google-drive-ocamlfuse

会出现以下提示

/bin/bash: google-drive-ocamlfuse: command not found

一般情况下这是因为没有将google-drive-ocamlfuse加入到环境变量文件/etc/profile,所以在这种情况下,我们首先寻找二进制文件在哪里:

find / -name google-drive-ocamlfuse

因而会输出以下的提示

/root/.opam/system/share/google-drive-ocamlfuse
/root/.opam/system/lib/google-drive-ocamlfuse
/root/.opam/system/etc/google-drive-ocamlfuse
/root/.opam/system/doc/google-drive-ocamlfuse
/root/.opam/system/bin/google-drive-ocamlfuse
/root/.opam/repo/default/packages/google-drive-ocamlfuse
/root/.opam/packages/google-drive-ocamlfuse

所以在以上的提示中找到bin中的google-drive-ocamlfuse

!/root/.opam/repo/default/packages/google-drive-ocamlfuse

发现这个可以使用,但是需要使用一些其他的软件

最后解决这个问题的完整代码


#装opam,后装google-drive-ocamlfuse
!apt-get install opam
!opam init
!opam update
!opam install depext
!opam depext google-drive-ocamlfuse
!opam install google-drive-ocamlfuse
#进行授权操作
from google.colab import auth
auth.authenticate_user()
from oauth2client.client import GoogleCredentials
creds = GoogleCredentials.get_application_default()
import getpass
!/root/.opam/system/bin/google-drive-ocamlfuse -headless -id={creds.client_id} -secret={creds.client_secret} < /dev/null 2>&1 | grep URL
vcode = getpass.getpass()
!echo {vcode} | /root/.opam/system/bin/google-drive-ocamlfuse -headless -id={creds.client_id} -secret={creds.client_secret}
#!!!注意,里面的/root/.opam/system/bin/google-drive-ocamlfuse换成你自己的路径,一般来说你也会得到和我一样的结果
# 指定Google Drive云端硬盘的根目录,名为drive
!mkdir -p drive
!/root/.opam/system/bin/google-drive-ocamlfuse drive

执行完这些代码之后就可以使用啦。
但是注意drive文件在content文件夹下面

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
加速基于相似性模型匹配的On-The-Fly相似性保持哈希 摘要: 在软件工程中,模型匹配是一项核心任务,广泛应用于模型驱动工程、软件重构、需求管理、代码检查等领域。由于模型通常包含大量的元素和复杂的结构,模型匹配问题变得越来越具有挑战性。相似性匹配是一种流行的模型匹配方法,它通过计算语义相似度来匹配模型元素。然而,由于相似性匹配算法的计算复杂度很高,导致它们的效率低下。 为了提高相似性匹配的效率,我们提出了一种基于On-The-Fly相似性保持哈希的加速方法。该方法利用哈希表将元素映射到桶中,并在桶中使用相似性保持哈希函数计算相似性,从而避免了在匹配过程中进行昂贵的相似性计算。此外,我们还提出了一种基于哈希冲突的剪枝策略,以进一步提高匹配效率。 我们在多个数据集上进行了实验,并与现有相似性匹配算法进行了比较。实验结果表明,我们的方法可以显著提高匹配效率,同时保持高精度。 关键词:模型匹配,相似性匹配,哈希,剪枝 Abstract: In software engineering, model matching is a core task widely applied in model-driven engineering, software refactoring, requirement management, code inspection, etc. Due to the fact that models usually contain a large number of elements and complex structures, model matching problems become increasingly challenging. Similarity-based matching is a popular model matching approach that matches model elements by computing semantic similarities. However, due to the high computational complexity of similarity-based matching algorithms, they suffer from poor efficiency. To improve the efficiency of similarity-based matching, we propose an acceleration method based on On-The-Fly similarity preserving hashing. This method uses a hash table to map elements to buckets and employs similarity preserving hash functions to compute similarities within buckets, thus avoiding expensive similarity computations during the matching process. In addition, we propose a hash conflict-based pruning strategy to further improve the matching efficiency. We conduct experiments on multiple datasets and compare our method with existing similarity-based matching algorithms. Experimental results show that our method can significantly improve the matching efficiency while maintaining high accuracy. Keywords: Model matching, similarity-based matching, hashing, pruning.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值