sanghyun-son / EDSR-PyTorch

PyTorch version of the paper 'Enhanced Deep Residual Networks for Single Image Super-Resolution' (CVPRW 2017)
MIT License
2.42k stars 668 forks source link

flair error in google colab #266

Open pablomascarenhas27 opened 4 years ago

pablomascarenhas27 commented 4 years ago

at first i was getting this error ERROR: datascience 0.10.6 has requirement folium==0.2.1, but you'll have folium 0.8.3 which is incompatible. which i resolved using this code !pip install --upgrade git+https://github.com/flairNLP/flair.git

then after doing that it gave me out out for the pre trained model so i moved to the custom trained model
import pandas as pd data = pd.read_csv("./spam.csv", encoding='latin-1').sample(frac=1).drop_duplicates() data = data[['v1', 'v2']].rename(columns={"v1":"label", "v2":"text"})

data['label'] = 'label' + data['label'].astype(str) data.iloc[0:int(len(data)0.8)].to_csv('train.csv', sep='\t', index = False, header = False) data.iloc[int(len(data)0.8):int(len(data)0.9)].to_csv('test.csv', sep='\t', index = False, header = False) data.iloc[int(len(data)0.9):].to_csv('dev.csv', sep='\t', index = False, header = False);

i ran the above code .after running the code it created train.csv,test.csv and dev.csv so i moved to the next part of the code that starts the training process this is the code below from flair.data_fetcher import NLPTaskDataFetcher from flair.embeddings import WordEmbeddings, FlairEmbeddings, DocumentLSTMEmbeddings from flair.models import TextClassifier from flair.trainers import ModelTrainer from pathlib import Path corpus = NLPTaskDataFetcher.load_classification_corpus(Path('./'), test_file='test.csv', dev_file='dev.csv', train_file='train.csv') word_embeddings = [WordEmbeddings('glove'), FlairEmbeddings('news-forward-fast'), FlairEmbeddings('news-backward-fast')] document_embeddings = DocumentLSTMEmbeddings(word_embeddings, hidden_size=512, reproject_words=True, reproject_words_dimension=256) classifier = TextClassifier(document_embeddings, label_dictionary=corpus.make_label_dictionary(), multi_label=False) trainer = ModelTrainer(classifier, corpus) trainer.train('./', max_epochs=10) after i start running the above code this is wat i get error

Originally posted by @pablomascarenhas27 in https://github.com/thstkdgus35/EDSR-PyTorch/issues/185#issuecomment-632633718

pablomascarenhas27 commented 4 years ago

solution for the above error is when you install flair just do the following code :

import torch !pip install flair==0.4 import flair all the issues will be resloved