Unsupported processor eroor on Amazon SageMaker notebook
Hello.I’m trying to train huggingface model on Amazon SageMaker and having error.ValueError: Unsupported processor: cpu. You may need to upgrade your SDK version (pip install -U sagemaker) for newer processors. Supported processor(s): gpu.I hope anyone may give some advise on what to do. thanks.I used the code from herehuggingface.corinna/japanese-roberta-base · Hugging FaceWe’re on a journey to advance and democratize artificial intelligence through open source and open science.・Select “train”・Set “Task”:Summarization, “Configuration”:AWS・Copy showed code and pasted to Amazon SageMaker notebook・Execute code and get the error.code is below. I changed source_dir and instance_type to fit my notebook.import sagemaker
from sagemaker.huggingface import HuggingFace

type or paste code here

# gets role for executing training job
role = sagemaker.get_execution_role()
hyperparameters = {
	'model_name_or_path':'rinna/japanese-roberta-base',
	'output_dir':'/opt/ml/model'
	# add your remaining hyperparameters
	# more info here https://github.com/huggingface/transformers/tree/v4.17.0/examples/pytorch/seq2seq
}

# git configuration to download our fine-tuning script
git_config = {'repo': 'https://github.com/huggingface/transformers.git','branch': 'v4.17.0'}

# creates Hugging Face estimator
huggingface_estimator = HuggingFace(
	entry_point='run_summarization.py',
	source_dir='./examples/pytorch/summarization',
	instance_type='ml.t2.medium',
	instance_count=1,
	role=role,
	git_config=git_config,
	transformers_version='4.17.0',
	pytorch_version='1.10.2',
	py_version='py38',
	hyperparameters = hyperparameters
)

# starting the train job
huggingface_estimator.fit()
2022-04-28T06:17:02Z
Hey@fikuegc,you are trying to use a CPU instance (t2.medium), which is not supported for training. You can use,e.g. a GPU instance likeml.g4dn.xlargeorml.p3.2xlarge.
2022-04-28T07:49:08Z
Thank you for your comment. and sorry my strange question.I changed to use ml.g4dn.xlarge but got same error.The code says “Unsupported processor: cpu”,  so it may want to use cpu.But there’s already cpu.I execute this↓torch.tensor([1.,2.]).deviceand I got this ↓device(type=‘cpu’)
2022-04-28T08:10:26Z
The notebook instance is not related to the training environment. If you are new to sagemaker i recommend you either read thedocumentationor take a look at thisvideo where we show to fine-tune transformers
2022-04-28T08:42:56Z
Thank you for your kind advise. I’m very new to sagemaker. I’ll check them.