Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac也是按这个步骤来吗,改成CPU训练就可以了嘛 #37

Open
Acheng97 opened this issue Aug 8, 2023 · 6 comments
Open

Mac也是按这个步骤来吗,改成CPU训练就可以了嘛 #37

Acheng97 opened this issue Aug 8, 2023 · 6 comments

Comments

@Acheng97
Copy link

Acheng97 commented Aug 8, 2023

No description provided.

@learnprogram2
Copy link

是的,但是时间很慢

@CHINAYNINI
Copy link

速度还可以吧MBP M2P芯片,12000个样本,十几分钟就好了

@learnprogram2
Copy link

速度还可以吧MBP M2P芯片,12000个样本,十几分钟就好了

@CHINAYNINI
请问可以看一下我这个为什么不可以么?将近20个小时了,然后log:

2023-08-25 14:31:56.929 | INFO     | utils.train:start:137 - [2023-08-25-14_31_55]      Epoch: 84       Step: 78000     LastLoss: 0.00012210002751089633      AvgLoss: 0.0001903036296425853  Lr: 0.004640778883287701        Acc: 0.90625
2023-08-25 14:33:57.223 | INFO     | utils.train:start:108 - [2023-08-25-14_33_55]      Epoch: 84       Step: 78100     LastLoss: 0.0002089805930154398       AvgLoss: 0.00016942865564487875 Lr: 0.0045479633056219465
2023-08-25 14:35:48.219 | INFO     | utils.train:start:108 - [2023-08-25-14_35_47]      Epoch: 84       Step: 78200     LastLoss: 0.00014516110240947455      AvgLoss: 0.00017116148985223844 Lr: 0.0045479633056219465

我的配置没变动,我以为target中的epoch是20,现在已经84了。 也是用的测试数据集
配置TARGET: {Accuracy: 0.97, Cost: 0.05, Epoch: 20}

@enphit
Copy link

enphit commented Sep 18, 2023

我这里100个图片,32G I9 Mac跑了三天还没完又是什么鬼?
2023-09-18 09:30:04.030 | INFO | utils.train:start:108 - [2023-09-18-09_30_03] Epoch: 141633 Step: 424900 LastLoss: 1.9247649106546305e-05 AvgLoss: 1.7899745298564085e-05 Lr: 0.0001380155583766437

@0x24a
Copy link

0x24a commented Feb 25, 2024

在colab上跑acc正常,把整个项目原封不动复制到本地mps跑acc就一直0.0...

@kvii
Copy link

kvii commented Mar 28, 2024

现代的模型已经用 cpu 训练的速度已经没法接受了。

其实 pytorch 是支持 mac 的,官网链接里都有 mac 版的下载方式

mac 下不用 cuda,只要声明 device 为 pytorch.device("mps") 就可以使用 mac 的 gpu 了。我没用过这个工程训练,不过我认为改这里的源码应该就能生效了。

def get_device(gpu_id):
if gpu_id == -1:
device = torch.device('cpu'.format(str(gpu_id)))
else:
device = torch.device('cuda:{}'.format(str(gpu_id)))
return device

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants