首页 > 其他分享 >鸢尾花yuan 训练学习 - xedu

鸢尾花yuan 训练学习 - xedu

时间:2023-12-15 15:12:03浏览次数:24  
标签:__ loss XEdu train xedu 鸢尾花 yuan model size

 

 

 

 

 

 

 

 

# coding:utf-8
from MMEdu import MMDetection as det
def generated_train():
    model = det(backbone='Yolov3')
    model.num_classes = 3
    model.load_dataset(path=r'D:\XEdu\datasets\mmedu_det\hand_gray')
    model.save_fold = r'D:\XEdu\my_checkpoints\mmedu_20231215_144712'
    model.train(epochs=5,validate=True,device='cpu',optimizer='SGD',lr=0.01, batch_size=None,weight_decay=0.001,checkpoint=None,random_seed=42)

if __name__ == '__main__':
    generated_train()

 

 

鸢尾花yuan

 

 

 

# coding:utf-8
from BaseNN import nn

def generated_train():
    model = nn()
    model.load_tab_data(r'D:\XEdu\datasets\basenn\iris\iris_training.csv',y_type='long',batch_size=32)
    model.save_fold = r'D:\XEdu\my_checkpoints\basenn_20231215_145215'
    model.set_seed(42)
    model.add(optimizer='Adam')
    model.add(layer='linear',size=(4, 10),activation='relu')
    model.add(layer='linear',size=(10, 2),activation='relu')
    model.add(layer='linear',size=(2, 2),activation='softmax')
    model.train(epochs=5,lr=0.01,loss='CrossEntropyLoss',metrics=['acc'])

if __name__ == '__main__':
    generated_train()

 

 

{'dataset': 'iris\\iris_training.csv', 'dataset_path': 'D:\\XEdu\\datasets\\basenn\\iris\\iris_training.csv', 'checkpoints_path': 'D:\\XEdu\\my_checkpoints\\basenn_20231215_150058', 'lr': 0.01, 'epochs': 10, 'network': [{'id': 1, 'type': 'linear', 'activation': 'relu', 'size': (4, 10)}, {'id': 2, 'type': 'linear', 'activation': 'relu', 'size': (10, 2)}, {'id': 3, 'type': 'linear', 'activation': 'softmax', 'size': (2, 2)}], 'pretrained_path': None, 'metrics': 'acc', 'loss': 'CrossEntropyLoss', 'random_seed': 42, 'batch_size': 32, 'optimizer': 'Adam'}
{'message': None, 'IsRunning': True, 'time_stamp': '20231215_150058', 'train_times': 1, 'pid': None}
basenn_poll_log_socket
error Traceback (most recent call last):
  File "D:\XEdu\basenn_code.py", line 16, in <module>
    generated_train()
  File "D:\XEdu\basenn_code.py", line 13, in generated_train
    model.train(epochs=10,lr=0.01,loss='CrossEntropyLoss',metrics=['acc'])
  File "D:\XEdu\env\lib\site-packages\BaseNN\BaseNN.py", line 657, in train
    loss = loss_fun(y_pred, batch_y)
  File "D:\XEdu\env\lib\site-packages\torch\nn\modules\module.py", line 889, in _call_impl
    result = self.forward(*input, **kwargs)
  File "D:\XEdu\env\lib\site-packages\torch\nn\modules\loss.py", line 1047, in forward
    return F.cross_entropy(input, target, weight=self.weight,
  File "D:\XEdu\env\lib\site-packages\torch\nn\functional.py", line 2693, in cross_entropy
    return nll_loss(log_softmax(input, 1), target, weight, None, ignore_index, None, reduction)
  File "D:\XEdu\env\lib\site-packages\torch\nn\functional.py", line 2388, in nll_loss
    ret = torch._C._nn.nll_loss(input, target, weight, _Reduction.get_enum(reduction), ignore_index)
IndexError: Target 2 is out of bounds.

  

 

标签:__,loss,XEdu,train,xedu,鸢尾花,yuan,model,size
From: https://www.cnblogs.com/flyingsir/p/17903416.html

相关文章

  • xedu 手势训练
       卸载pip uninstall easy-xedu -y安装pip install easy-xedu -i https://pypi.tuna.tsinghua.edu.cn/simple执行easytrain访问:http://127.0.0.1:5000/mmedu/index          importcv2importBaseDeployasbdmodel_path=r'......
  • Python用正则化Lasso、岭回归预测房价、随机森林交叉验证鸢尾花数据可视化2案例
    机器学习模型的表现不佳通常是由于过度拟合或欠拟合引起的,我们将重点关注客户经常遇到的过拟合情况。过度拟合是指学习的假设在训练数据上拟合得非常好,以至于对未见数据的模型性能造成负面影响。该模型对于训练数据中没有的新实例的泛化能力较差。复杂模型,如随机森林、神经网络和X......
  • siyuan持续集成平台
    一powershell中使用git命令1、下载post-git离线安装包2,用Powershell执行install.ps13.用管理员权限打开powershell,修改策略:下载地址:链接:https://pan.baidu.com/s/155cPpvhQUhnrk2jRBACLdw?pwd=ch4f 提取码:ch4f 二gitlab服务器安装https://www.cnblogs.com/lyn8100/p/1......
  • Unity 修改 FixedUpdate 时间间隔
    1.依次点击Edit->ProjectSetting->Time后,在打开的窗口中修改FixedTimestep即可。如下图所示: ......
  • Python用正则化Lasso、岭回归预测房价、随机森林交叉验证鸢尾花数据可视化2案例
    全文链接:https://tecdat.cn/?p=33632原文出处:拓端数据部落公众号机器学习模型的表现不佳通常是由于过度拟合或欠拟合引起的,我们将重点关注客户经常遇到的过拟合情况。过度拟合是指学习的假设在训练数据上拟合得非常好,以至于对未见数据的模型性能造成负面影响。该模型对于训练数......
  • Daimayuan Online Judge 线段树打标记2
    给\(n\)个数\(a_1,a_2,\cdots,a_n\)。支持\(q\)个操作:1lrd,令所有的\(a_i(l\leqi\leqr)\)加上\(d\)。2lrd,令所有的\(a_i(l\leqi\leqr)\)乘上\(d\)。3lrd,令所有的\(a_i(l\leqi\leqr)\)等于\(d\)。4lr,查询\((\sum_{i=l......
  • Daimayuan Online Judge 线段树打标记1
    给\(n\)个数\(a_1,a_2,\cdots,a_n\)。支持\(q\)个操作:1lrd,令所有的\(a_i(l\leqi\leqr)\)加上\(d\)。2lr,查询\(max_{i=l}^{r}a_i\)。区间修改的线段树要比基础线段树多考虑一个元素:\(lazy\tag\)。复杂的信息可以用多个标记表示。\(lazy\ta......
  • Daimayuan Online Judge 线段树2
    给\(n\)个数\(a_1,a_2,\cdots,a_n\)。支持\(q\)个操作:1xd,修改\(a_x=d\)。2lr,查询\([l,r]\)中的最大子段和。一:确定需要维护的信息。根据分治中线讨论,哪些信息可以合并出所需信息。递归讨论新信息如何合并。直至完全拆解。不越过分治中线:\([l,r]\)......
  • Daimayuan Online Judge 线段树1
    给\(n\)个数\(a_1,a_2,\cdots,a_n\)。支持\(q\)个操作:1.1xd,修改\(a_x=d\)。2.2lr,查询\(min_{i=l}^{r}a_i\),并输出\(\sum_{i=l}^{r}[a_i=min_{i=l}^{r}a_i]\)。一:确定出需要维护的信息\(Info\)。建立线段树节点structInfo{ intminv......
  • daimayuan252 | 摸鱼(状压, 枚举, 小技巧)
    题目很straightforward的,看到n范围很小考虑状压,暴力枚举所有的可能pattern.第一种做法,暴力枚举是\(O(2^n)\)的,然后check函数判断是\(O(n^2)\)的,一共是\(O(n^22^n)\)的,可以通过.第二种做法,我们考虑把判断pattern是否合法的限制条件也压成二进制串,那么我们比对条......