C2W1 Lab - Unable to proceed and stuck in cell 1 on execution

Stuck in cell1 of the lab (waited for more than an hour) attached image below:

Any help?

1 Like

Dear @anandan,

Restart the kernel and try to run the cells of notebook again.

I will try but is there any problem with pytorch or it’s version or any dependency like everyone has been facing??

1 Like

Reinstalled the required version of pytorch.
This may work, otherwise let me know,

@Girijesh I am also facing the same issue. I get this error:

The environment is inconsistent, please check the package plan carefully
The following packages are causing the inconsistency:

  • defaults/linux-64::anaconda-client==1.7.2=py37_0
  • defaults/noarch::anaconda-project==0.8.4=py_0
  • defaults/linux-64::bokeh==1.4.0=py37_0
  • defaults/noarch::dask==2.11.0=py_0
  • defaults/linux-64::distributed==2.11.0=py37_0
  • defaults/linux-64::spyder==4.0.1=py37_0
  • defaults/linux-64::watchdog==0.10.2=py37_0

Which pytorch version is compatible?

1 Like

Dear @Dikshit_Venkatesh,

Welcome to the community.

Try using the latest version.
BTW, What python version are you using?

@Dikshit_Venkatesh restarting kernel and checking the python version will not work. Follow this or you might need to do further debugging.

After heavy debugging, below worked for me under the pip install section (PS: been a month over and not sure what is the correct version but you can try if it works then great…):
!pip install --disable-pip-version-check -q sagemaker==2.192.1
!conda install -y -c pytorch pytorch
!pip install --disable-pip-version-check -q transformers
!pip install --disable-pip-version-check -q protobuf==3.20.*

I think this is the same even with the prepare_data.py file if you have one. You might need to install the appropriate version of the packages.

1 Like

Hi @anandan , how did u resolve the issue in prepare_data.py file. I am getting the same type of error.

1 Like

I have extracted part of the content from prepare_data.py hope this is the correct and works. Basically the one with install package with proper version like 2.192.1. Match the contents with the one you are having ‘prepare_data.py’ and take the difference [Apologies can’t be precise been a long time on this lab…].

from sklearn.model_selection import train_test_split
from sklearn.utils import resample
import functools
import multiprocessing

from datetime import datetime
from time import gmtime, strftime, sleep

import pandas as pd
import argparse
import subprocess
import sys
import os
import re
import collections
import json
import csv
import glob
from pathlib import Path
import time
import boto3

# subprocess.check_call([sys.executable, "-m", "conda", "install", "-c", "pytorch", "pytorch==1.6.0", "-y"])
subprocess.check_call([sys.executable, "-m", "conda", "install", "-q", "-y", "pytorch", "-c", "pytorch"])

subprocess.check_call([sys.executable, "-m", "pip", "install", "transformers"])
from transformers import RobertaTokenizer

if __name__ == "__main__":
    os.system('pip install sagemaker==2.192.1')
import sagemaker

from sagemaker.session import Session
from sagemaker.feature_store.feature_group import FeatureGroup
from sagemaker.feature_store.feature_definition import (
    FeatureDefinition,
    FeatureTypeEnum,
)

################################################################################################################################################
###################################################### Setup environmental variables ###########################################################
################################################################################################################################################

region = os.environ['AWS_DEFAULT_REGION']
1 Like