Ludwig没有在Anaconda上运行,突然在开始训练之前停止,

9njqaruj  于 2个月前  发布在  其他
关注(0)|答案(7)|浏览(23)

当我在Anaconda中运行Ludwig时,我得到了一个实验描述,数据已经预处理,我看到了"model", "Warnings and other logs",但是这些都是空的。
我在Macbook Pro M1上运行着Python 3 (ipykernel)的Jupyter Notebook 6.4.8,系统是Ventura 13.1 (22C65)。
这里出了什么问题?它确实可以在Google Colab上运行(使用PyTorch),我也尝试在Jupyter Notebook上运行,但没有成功。我只是想在我的笔记本电脑上使用M1芯片训练我的数据。
我正在运行以下代码:

!pip install tensorflow
import pandas as pd
from datetime import datetime as dt
import numpy as np
from pandas.core.base import value_counts

///importing and cleaning dataset and saving it as 'CompanyAndIndust.csv'

model_definition="""

input_features:
    -
        name: name
        type: text
        level: word
        encoder: parallel_cnn

output_features:
    -
        name: industry
        type: text
    

"""

with open("model_definition.yaml", "w") as f:
  f.write(model_definition)
  

!ludwig experiment \
 --dataset CompanyAndIndust.csv\
 --config model_definition.yaml

我没有收到任何错误或任何其他信息,它只是停止显示以下内容:

Note: NumExpr detected 10 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 8.
NumExpr defaulting to 8 threads.
███████████████████████
█ █ █ █  ▜█ █ █ █ █   █
█ █ █ █ █ █ █ █ █ █ ███
█ █   █ █ █ █ █ █ █ ▌ █
█ █████ █ █ █ █ █ █ █ █
█     █  ▟█     █ █   █
███████████████████████
ludwig v0.6 - Experiment

╒════════════════════════╕
│ EXPERIMENT DESCRIPTION │
╘════════════════════════╛

╒══════════════════╤═══════════════════════════════════════════════════════════════════════════════╕
│ Experiment name  │ experiment                                                                    │
├──────────────────┼───────────────────────────────────────────────────────────────────────────────┤
│ Model name       │ run                                                                           │
├──────────────────┼───────────────────────────────────────────────────────────────────────────────┤
│ Output directory │ /Users/marijnquartel/Documents/Data/Industry Report/results/experiment_run_10 │
├──────────────────┼───────────────────────────────────────────────────────────────────────────────┤
│ ludwig_version   │ '0.6'                                                                         │
├──────────────────┼───────────────────────────────────────────────────────────────────────────────┤
│ command          │ ('/Users/marijnquartel/opt/anaconda3/bin/ludwig experiment --dataset '        │
│                  │  'CompanyAndIndust.csv --config model_definition.yaml')                       │
├──────────────────┼───────────────────────────────────────────────────────────────────────────────┤
│ random_seed      │ 42                                                                            │
├──────────────────┼───────────────────────────────────────────────────────────────────────────────┤
│ dataset          │ 'CompanyAndIndust.csv'                                                        │
├──────────────────┼───────────────────────────────────────────────────────────────────────────────┤
│ data_format      │ 'csv'                                                                         │
├──────────────────┼───────────────────────────────────────────────────────────────────────────────┤
│ torch_version    │ '1.13.1'                                                                      │
├──────────────────┼───────────────────────────────────────────────────────────────────────────────┤
│ compute          │ {'num_nodes': 1}                                                              │
╘══════════════════╧═══════════════════════════════════════════════════════════════════════════════╛

╒═══════════════╕
│ LUDWIG CONFIG │
╘═══════════════╛

{   'combiner': {   'activation': 'relu',
                    'bias_initializer': 'zeros',
                    'dropout': 0.0,
                    'fc_layers': None,
                    'flatten_inputs': False,
                    'norm': None,
                    'norm_params': None,
                    'num_fc_layers': 0,
                    'output_size': 256,
                    'residual': False,
                    'type': 'concat',
                    'use_bias': True,
                    'weights_initializer': 'xavier_uniform'},
    'defaults': {   'audio': {   'preprocessing': {   'audio_file_length_limit_in_s': 7.5,
                                                      'computed_fill_value': None,
                                                      'fill_value': None,
                                                      'in_memory': True,
                                                      'missing_value_strategy': 'bfill',
                                                      'norm': None,
                                                      'num_fft_points': None,
                                                      'num_filter_bands': 80,
                                                      'padding_value': 0.0,
                                                      'type': 'fbank',
                                                      'window_length_in_s': 0.04,
                                                      'window_shift_in_s': 0.02,
                                                      'window_type': 'hamming'}},
                    'bag': {   'preprocessing': {   'computed_fill_value': '<UNK>',
                                                    'fill_value': '<UNK>',
                                                    'lowercase': False,
                                                    'missing_value_strategy': 'fill_with_const',
                                                    'most_common': 10000,
                                                    'tokenizer': 'space'}},
                    'binary': {   'preprocessing': {   'computed_fill_value': None,
                                                       'fallback_true_label': None,
                                                       'fill_value': None,
                                                       'missing_value_strategy': 'fill_with_false'}},
                    'category': {   'preprocessing': {   'computed_fill_value': '<UNK>',
                                                         'fill_value': '<UNK>',
                                                         'lowercase': False,
                                                         'missing_value_strategy': 'fill_with_const',
                                                         'most_common': 10000}},
                    'date': {   'preprocessing': {   'computed_fill_value': '',
                                                     'datetime_format': None,
                                                     'fill_value': '',
                                                     'missing_value_strategy': 'fill_with_const'}},
                    'h3': {   'preprocessing': {   'computed_fill_value': 576495936675512319,
                                                   'fill_value': 576495936675512319,
                                                   'missing_value_strategy': 'fill_with_const'}},
                    'image': {   'preprocessing': {   'computed_fill_value': None,
                                                      'fill_value': None,
                                                      'height': None,
                                                      'in_memory': True,
                                                      'infer_image_dimensions': True,
                                                      'infer_image_max_height': 256,
                                                      'infer_image_max_width': 256,
                                                      'infer_image_num_channels': True,
                                                      'infer_image_sample_size': 100,
                                                      'missing_value_strategy': 'bfill',
                                                      'num_channels': None,
                                                      'num_processes': 1,
                                                      'resize_method': 'interpolate',
                                                      'scaling': 'pixel_normalization',
                                                      'width': None}},
                    'number': {   'preprocessing': {   'computed_fill_value': 0.0,
                                                       'fill_value': 0.0,
                                                       'missing_value_strategy': 'fill_with_const',
                                                       'normalization': None}},
                    'sequence': {   'preprocessing': {   'computed_fill_value': '<UNK>',
                                                         'fill_value': '<UNK>',
                                                         'lowercase': False,
                                                         'max_sequence_length': 256,
                                                         'missing_value_strategy': 'fill_with_const',
                                                         'most_common': 20000,
                                                         'padding': 'right',
                                                         'padding_symbol': '<PAD>',
                                                         'tokenizer': 'space',
                                                         'unknown_symbol': '<UNK>',
                                                         'vocab_file': None}},
                    'set': {   'preprocessing': {   'computed_fill_value': '<UNK>',
                                                    'fill_value': '<UNK>',
                                                    'lowercase': False,
                                                    'missing_value_strategy': 'fill_with_const',
                                                    'most_common': 10000,
                                                    'tokenizer': 'space'}},
                    'text': {   'preprocessing': {   'computed_fill_value': '<UNK>',
                                                     'fill_value': '<UNK>',
                                                     'lowercase': True,
                                                     'max_sequence_length': 256,
                                                     'missing_value_strategy': 'fill_with_const',
                                                     'most_common': 20000,
                                                     'padding': 'right',
                                                     'padding_symbol': '<PAD>',
                                                     'pretrained_model_name_or_path': None,
                                                     'tokenizer': 'space_punct',
                                                     'unknown_symbol': '<UNK>',
                                                     'vocab_file': None}},
                    'timeseries': {   'preprocessing': {   'computed_fill_value': '',
                                                           'fill_value': '',
                                                           'missing_value_strategy': 'fill_with_const',
                                                           'padding': 'right',
                                                           'padding_value': 0.0,
                                                           'timeseries_length_limit': 256,
                                                           'tokenizer': 'space'}},
                    'vector': {   'preprocessing': {   'computed_fill_value': '',
                                                       'fill_value': '',
                                                       'missing_value_strategy': 'fill_with_const',
                                                       'vector_size': None}}},
    'input_features': [   {   'column': 'name',
                              'encoder': {   'level': 'word',
                                             'type': 'parallel_cnn'},
                              'name': 'name',
                              'proc_column': 'name_mZFLky',
                              'tied': None,
                              'type': 'text'}],
    'ludwig_version': '0.6',
    'model_type': 'ecd',
    'output_features': [   {   'column': 'industry',
                               'decoder': {'type': 'generator'},
                               'dependencies': [],
                               'loss': {   'class_similarities_temperature': 0,
                                           'class_weights': None,
                                           'confidence_penalty': 0.0,
                                           'robust_lambda': 0,
                                           'type': 'sequence_softmax_cross_entropy',
                                           'unique': False,
                                           'weight': 1.0},
                               'name': 'industry',
                               'preprocessing': {   'missing_value_strategy': 'drop_row'},
                               'proc_column': 'industry_mZFLky',
                               'reduce_dependencies': 'sum',
                               'reduce_input': 'sum',
                               'type': 'text'}],
    'preprocessing': {   'oversample_minority': None,
                         'sample_ratio': 1.0,
                         'split': {   'probabilities': [0.7, 0.1, 0.2],
                                      'type': 'random'},
                         'undersample_majority': None},
    'trainer': {   'batch_size': 128,
                   'checkpoints_per_epoch': 0,
                   'decay': False,
                   'decay_rate': 0.96,
                   'decay_steps': 10000,
                   'early_stop': 5,
                   'epochs': 100,
                   'eval_batch_size': None,
                   'evaluate_training_set': True,
                   'gradient_clipping': {   'clipglobalnorm': 0.5,
                                            'clipnorm': None,
                                            'clipvalue': None},
                   'increase_batch_size_eval_metric': 'loss',
                   'increase_batch_size_eval_split': 'training',
                   'increase_batch_size_on_plateau': 0,
                   'increase_batch_size_on_plateau_max': 512,
                   'increase_batch_size_on_plateau_patience': 5,
                   'increase_batch_size_on_plateau_rate': 2.0,
                   'learning_rate': 0.001,
                   'learning_rate_scaling': 'linear',
                   'learning_rate_warmup_epochs': 1.0,
                   'optimizer': {   'amsgrad': False,
                                    'betas': (0.9, 0.999),
                                    'eps': 1e-08,
                                    'lr': 0.001,
                                    'type': 'adam',
                                    'weight_decay': 0.0},
                   'reduce_learning_rate_eval_metric': 'loss',
                   'reduce_learning_rate_eval_split': 'training',
                   'reduce_learning_rate_on_plateau': 0.0,
                   'reduce_learning_rate_on_plateau_patience': 5,
                   'reduce_learning_rate_on_plateau_rate': 0.5,
                   'regularization_lambda': 0.0,
                   'regularization_type': 'l2',
                   'should_shuffle': True,
                   'staircase': False,
                   'steps_per_checkpoint': 0,
                   'train_steps': None,
                   'type': 'trainer',
                   'validation_field': 'combined',
                   'validation_metric': 'loss'}}

╒═══════════════╕
│ PREPROCESSING │
╘═══════════════╛

Found cached dataset and meta.json with the same filename of the dataset, using them instead
Using full hdf5 and json
Loading data from: CompanyAndIndust.training.hdf5
Loading data from: CompanyAndIndust.validation.hdf5
Loading data from: CompanyAndIndust.test.hdf5

Dataset Statistics
╒════════════╤═══════════════╤════════════════════╕
│ Dataset    │   Size (Rows) │ Size (In Memory)   │
╞════════════╪═══════════════╪════════════════════╡
│ Training   │       1358000 │ 290.10 Mb          │
├────────────┼───────────────┼────────────────────┤
│ Validation │        194000 │ 41.44 Mb           │
├────────────┼───────────────┼────────────────────┤
│ Test       │        388000 │ 82.89 Mb           │
╘════════════╧═══════════════╧════════════════════╛

╒═══════╕
│ MODEL │
╘═══════╛

Warnings and other logs:
xdyibdwo

xdyibdwo1#

嘿,@MarijnQ,为了澄清你所看到的行为:进程是在挂起还是退出?如果是退出,你是否知道退出代码是什么?

xmakbtuz

xmakbtuz2#

在Anaconda中,我在代码块中拥有所有内容。它只是完成代码块并将其留在那里。没有退出码/错误码。
如果我想要,我可以启动一个新的代码块并且机器可以正常工作,但是Ludwig不会训练。

xpszyzbs

xpszyzbs3#

感谢@MarijnQ。我想知道是否有错误信息被notebook吞噬了。有几件事可以尝试:

  • 检查notebook服务器的服务器日志,看看那里是否有类似错误信息的内容。
  • 尝试在notebook之外运行相同的代码,使用普通的Python脚本或命令行,并查看是否会引发错误。

如果这些都不起作用,我会尝试确保我们的示例脚本可以运行,例如我们已经拥有的泰坦尼克号示例 here ,以检查错误是否特定于您的数据集/模型配置。
另外我要提到的一件事是,我们刚刚为MPS添加了对M1加速的支持。要尝试一下,请确保您已安装了Ludwig的master分支,并在环境中设置 LUDWIG_ENABLE_MPS=1

0pizxfdo

0pizxfdo4#

@tgaddair Amazing, I'll try these tomorrow! 👍

sg24os4d

sg24os4d5#

好的,当我设置LUDWIG_ENABLE_MPS=1时,我得到了错误ModuleNotFoundError: No module named 'mlflow'。在Jupyter Notebook中,我似乎无法获取日志文件,还没有找到获取这些文件的方法。我尝试在Mac终端中运行它,并对代码进行了修改以使其能够运行,但它一直弹出语法或缩进错误。有没有其他环境我可以尝试?

我现在运行的代码是当前的代码,而不是来自终端的代码:

!pip install 'ludwig[full]'--LUDWIG_ENABLE_MPS=1

!pip install torch -f https://download.pytorch.org/whl/cu113/torch_stable.html

import pandas as pd
from datetime import datetime as dt
import numpy as np
from pandas.core.base import value_counts

df2 = pd.read_csv("/Users/marijnquartel/Documents/Data/Industry Report/CompanyName_Industry.csv", index_col=0)

df2 = df2.replace({'industry': {'non-profit organization management': 'philanthropy', 'motion pictures and film':'entertainment', 'music':'entertainment','performing arts':'entertainment','law practice':'legal services','e-learning':'education','education management':'education','higher education':'education','media production':'entertainment','primary/secondary education':'education'}})

#Delete every category that has less than 500 entries
thresholdVal = 1000
df = df2[df2.groupby("industry")["industry"].transform('size')>=thresholdVal]

#Create a sample of the dataset in equal sizes based on industry 
dataset = df.groupby('industry').apply(lambda x: x.sample(200,replace=True))
dataset.reset_index(drop=True, inplace=True)

dataset['industry'].replace('\s+', '_',regex=True,inplace=True)
dataset['industry'].replace('&', 'and',regex=True,inplace=True)
dataset['industry'].replace('/', '_or_',regex=True,inplace=True)
dataset['industry'].replace('-', '_',regex=True,inplace=True)
dataset['industry'].replace(',', '_',regex=True,inplace=True)
dataset.to_csv('CompanyAndIndust.csv')

model_definition="""

input_features:
    -
        name: name
        type: text
        level: word
        encoder: parallel_cnn

output_features:
    -
        name: industry
        type: text
    

"""

with open("model_definition.yaml", "w") as f:
  f.write(model_definition)
  

!ludwig experiment \
    --dataset CompanyAndIndust.csv\
    --config model_definition.yaml
--dataset CompanyAndIndust.csv\
--config model_definition.yaml
u4dcyp6a

u4dcyp6a6#

我刚刚尝试运行你们在网站入门部分提供的烂番茄评级系统。

$x_1^a_0b_1^x$

这引发了错误

$x_1^m_0n_1^x$

hgtggwj0

hgtggwj07#

Here I am again.
I have tried running Colab on a local runtime and I go this error message:

/Users/marijnquartel/opt/anaconda3/lib/python3.9/site-packages/torch/nn/modules/conv.py:309: UserWarning: Using padding='same' with even kernel lengths and odd dilation may require a zero-padded copy of the input be created (Triggered internally at /Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/Convolution.cpp:896.)
  return F.conv1d(input, weight, bias, self.stride,

Got nothing when I enabled the MPS

相关问题