Code Monkey home page Code Monkey logo

age-estimation-pytorch's Introduction

yu4u's github stats

age-estimation-pytorch's People

Contributors

dependabot[bot] avatar yu4u avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

age-estimation-pytorch's Issues

License

Hi,
thank you for making your code public. Would it be possible to attach some sort of license?

cv2.error

(base) C:\Users\茅场晶彦\PycharmProjects\age-estimation-pytorch-master>python train.py --data_dir C:\Users\茅场晶彦\PycharmProjects\age-estimation-pytorch-master\appa-real-release TRAIN.BATCH_SIZE 8 MODEL.ARCH resnet34
=> creating model 'resnet34'
0%| | 0/499 [00:00<?, ?it/s]
Traceback (most recent call last):
File "train.py", line 244, in
main()
File "train.py", line 206, in main
train_loss, train_acc = train(train_loader, model, criterion, optimizer, epoch, device)
File "train.py", line 62, in train
for x, y in _tqdm:
File "D:\ANA\lib\site-packages\tqdm_tqdm.py", line 937, in iter
for obj in iterable:
File "D:\ANA\lib\site-packages\torch\utils\data\dataloader.py", line 346, in next
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "D:\ANA\lib\site-packages\torch\utils\data_utils\fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "D:\ANA\lib\site-packages\torch\utils\data_utils\fetch.py", line 44, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "C:\Users\茅场晶彦\PycharmProjects\age-estimation-pytorch-master\dataset.py", line 79, in getitem
img = cv2.resize(img, (self.img_size, self.img_size))
cv2.error: OpenCV(4.1.1) C:\projects\opencv-python\opencv\modules\imgproc\src\resize.cpp:3720: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize'

FileNotFoundError: [Errno 2]

Thank you for the last answer for my question.

But I have another problem.
occur this error

Traceback (most recent call last):
File "train.py", line 246, in
main()
File "train.py", line 188, in main
age_stddev=cfg.TRAIN.AGE_STDDEV)
File "C:\Users\intel\Desktop\capstone\age-estimation-pytorch-master\dataset.py", line 52, in init
df = pd.read_csv(str(csv_path))
File "C:\Users\intel\AppData\Local\Programs\Python\Python36\lib\site-packages\pandas\io\parsers.py", line 676, in parser_f
return _read(filepath_or_buffer, kwds)
File "C:\Users\intel\AppData\Local\Programs\Python\Python36\lib\site-packages\pandas\io\parsers.py", line 448, in _read
parser = TextFileReader(fp_or_buf, kwds)
File "C:\Users\intel\AppData\Local\Programs\Python\Python36\lib\site-packages\pandas\io\parsers.py", line 880, in init
self._make_engine(self.engine)
File "C:\Users\intel\AppData\Local\Programs\Python\Python36\lib\site-packages\pandas\io\parsers.py", line 1114, in _make_engine
self._engine = CParserWrapper(self.f, self.options)
File "C:\Users\intel\AppData\Local\Programs\Python\Python36\lib\site-packages\pandas\io\parsers.py", line 1891, in init
self._reader = parsers.TextReader(src, **kwds)
File "pandas_libs\parsers.pyx", line 374, in pandas._libs.parsers.TextReader.cinit
File "pandas_libs\parsers.pyx", line 674, in pandas._libs.parsers.TextReader._setup_parser_source
FileNotFoundError: [Errno 2] File \appa-real-release\gt_avg_train.csv does not exist: '\appa-real-release\gt_avg_train.csv'

How can I get this problem... please help me. T.T

Inquiry about the training model

Hello, can you explain what is ARCH model(get_model(model_name=cfg.MODEL.ARCH.)? I have not got any useful searching result about ARCH model what ARCH. Thank you so much.

the same question :FileNotFoundError

At your suggestion, I've tried [ python train.py --data_dir /appa-real-release TRAIN.BATCH_SIZE 16 MODEL.ARCH resnet34]
But after downloading the model, it says:
=> creating model 'resnet34'
Traceback (most recent call last):
File "train.py", line 244, in
main()
File "train.py", line 186, in main
age_stddev=cfg.TRAIN.AGE_STDDEV)
File "C:\Users\茅场晶彦\PycharmProjects\age-estimation-pytorch-master\dataset.py", line 52, in init
df = pd.read_csv(str(csv_path))
File "D:\ANA\lib\site-packages\pandas\io\parsers.py", line 678, in parser_f
return _read(filepath_or_buffer, kwds)
File "D:\ANA\lib\site-packages\pandas\io\parsers.py", line 440, in _read
parser = TextFileReader(filepath_or_buffer, **kwds)
File "D:\ANA\lib\site-packages\pandas\io\parsers.py", line 787, in init
self._make_engine(self.engine)
File "D:\ANA\lib\site-packages\pandas\io\parsers.py", line 1014, in _make_engine
self._engine = CParserWrapper(self.f, **self.options)
File "D:\ANA\lib\site-packages\pandas\io\parsers.py", line 1708, in init
self._reader = parsers.TextReader(src, **kwds)
File "pandas_libs\parsers.pyx", line 384, in pandas._libs.parsers.TextReader.cinit
File "pandas_libs\parsers.pyx", line 695, in pandas._libs.parsers.TextReader._setup_parser_source
FileNotFoundError: File b'\appa-real-release\gt_avg_train.csv' does not exist

i've checked the dataset path,it's right, then, open the CSV file, and download the relevant part
But the problem remains

What is the final (top-k-)accuracy?

Does it correspond to the reported MAE? In other words, does it have 96% accuracy? Cause other models seem to have fairly poor performance in age estimation, ranging from 10-30% accuracy.

run problem

when i run the code
!python train.py --data_dir data_dir/appa-real-release --tensorboard tf_log MODEL.ARCH se_resnet50 TRAIN.OPT sgd TRAIN.LR 0.1

it has a response like :
=> creating model 'se_resnet50'
0% 0/31 [00:00<?, ?it/s]^C

can you tell me how to fix this please

cuda memory out

no matter sever i chose with k80 or v100 or k80*8 but still the same error like:
this is the error when i use v100

CUDA out of memory. Tried to allocate 98.00 MiB (GPU 0; 15.75 GiB total capacity; 14.64 GiB already allocated; 36.88 MiB free; 20.85 MiB cached)

how can i fix this

About Outputs

I read your code carefully. In train.py, I'm not sure what outputs means. Is it the output of the model FC layer or the Softmax layer?
Because if it's the output of the FC layer, then it's contradictory to _ predicted = outputs.max (1), and if it's the output of the Softmax layer, it's contradictory to loss = criterion (outputs, y). What's going on?
Please take the precious time to help me, because I urgently need to get the correct conclusion and thank you for your help.

run time error

creating model 'se_resnext50_32x4d'
0% 0/31 [00:00<?, ?it/s]^C

how to fix this error.

please help me with this.
Thank you

The MAE's minimum value

Thanks to the excellent code of the blogger, I trained 80epoch with your code on GPU GTX 1080ti, but my mae minimum is 4.144, and your mae dropped to 3.9 at 44epoch. Is my luck bad? Is this mae related to computing power, or is it random with every training?Thank you very much!

run demo

ImportError: libcudart.so.9.0: cannot open shared object file: No such file or directory

run train error

Hello, I'm having a problem, when i run cmd "python train.py --data_dir data/appa-real-release --multi_gpu --tensorboard tf_log", struck a error:

=> creating model 'se_resnext50_32x4d'
2021-03-13 02:19:44.210801: W tensorflow/stream_executor/platform/default/dso_loader.cc:60] Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found
2021-03-13 02:19:44.211070: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
  0%|                                                                                                                    | 0/31 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "train.py", line 246, in <module>
    main()
  File "train.py", line 206, in main
    train_loss, train_acc = train(train_loader, model, criterion, optimizer, epoch, device)
  File "train.py", line 62, in train
    for x, y in _tqdm:
  File "C:\Users\sungh\AppData\Local\Programs\Python\Python38\lib\site-packages\tqdm\_tqdm.py", line 1017, in __iter__
    for obj in iterable:
  File "C:\Users\sungh\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\utils\data\dataloader.py", line 517, in __next__
    data = self._next_data()
  File "C:\Users\sungh\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\utils\data\dataloader.py", line 1199, in _next_data   
    return self._process_data(data)
  File "C:\Users\sungh\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\utils\data\dataloader.py", line 1225, in _process_data
    data.reraise()
  File "C:\Users\sungh\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\_utils.py", line 429, in reraise
    raise self.exc_type(msg)
TypeError: Caught TypeError in DataLoader worker process 0.
Original Traceback (most recent call last):
  File "C:\Users\sungh\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\utils\data\_utils\worker.py", line 202, in _worker_loop    
    data = fetcher.fetch(index)
  File "C:\Users\sungh\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\utils\data\_utils\fetch.py", line 44, in fetch
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "C:\Users\sungh\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\utils\data\_utils\fetch.py", line 44, in <listcomp>        
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "G:\python_project\age-estimation-pytorch-master\dataset.py", line 80, in __getitem__
    img = self.transform(img).astype(np.float32)
  File "G:\python_project\age-estimation-pytorch-master\dataset.py", line 31, in __call__
    img = self.aug.augment_image(img)
  File "C:\Users\sungh\AppData\Local\Programs\Python\Python38\lib\site-packages\imgaug\augmenters\meta.py", line 771, in augment_image
    return self.augment_images([image], hooks=hooks)[0]
  File "C:\Users\sungh\AppData\Local\Programs\Python\Python38\lib\site-packages\imgaug\augmenters\meta.py", line 822, in augment_images
    return self.augment_batch_(
  File "C:\Users\sungh\AppData\Local\Programs\Python\Python38\lib\site-packages\imgaug\augmenters\meta.py", line 641, in augment_batch_
    batch_inaug = self._augment_batch_(
  File "C:\Users\sungh\AppData\Local\Programs\Python\Python38\lib\site-packages\imgaug\augmenters\meta.py", line 3124, in _augment_batch_        
    batch = self[index].augment_batch_(
  File "C:\Users\sungh\AppData\Local\Programs\Python\Python38\lib\site-packages\imgaug\augmenters\meta.py", line 641, in augment_batch_
    batch_inaug = self._augment_batch_(
  File "C:\Users\sungh\AppData\Local\Programs\Python\Python38\lib\site-packages\imgaug\augmenters\color.py", line 2470, in _augment_batch_       
    image_hsv = self._transform_image_cv2(
  File "C:\Users\sungh\AppData\Local\Programs\Python\Python38\lib\site-packages\imgaug\augmenters\color.py", line 2501, in _transform_image_cv2  
    table_hue = cls._LUT_CACHE[0]
TypeError: 'NoneType' object is not subscriptable

Anyone helps me, thanks so much !!!

Run time error

error code >>

Traceback (most recent call last):
File "train.py", line 244, in
main()
File "train.py", line 151, in main
model = get_model(model_name=cfg.MODEL.ARCH)
File "C:\Users\intel\Desktop\capstone\age-estimation-pytorch-master\model.py", line 7, in get_model
model = pretrainedmodels.dictmodel_name
File "C:\Users\intel\AppData\Local\Programs\Python\Python36\lib\site-packages\pretrainedmodels\models\senet.py", line 430, in se_resnext50_32x4d
initialize_pretrained_model(model, num_classes, settings)
File "C:\Users\intel\AppData\Local\Programs\Python\Python36\lib\site-packages\pretrainedmodels\models\senet.py", line 373, in initialize_pretrained_model
model.load_state_dict(model_zoo.load_url(settings['url']))
File "C:\Users\intel\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\hub.py", line 506, in load_state_dict_from_url
return torch.load(cached_file, map_location=map_location)
File "C:\Users\intel\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\serialization.py", line 529, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
File "C:\Users\intel\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\serialization.py", line 709, in _legacy_load
deserialized_objects[key]._set_from_file(f, offset, f_should_read_directly)
RuntimeError: unexpected EOF, expected 54168 more bytes. The file might be corrupted.

The error occurred as above.
I tried several times, but the same error occurs.
I tried entering this code.

python train.py --data_dir /appa-real-release TRAIN.BATCH_SIZE 16

I tried entering the batch size differently, but the same error occurred.
Please help me how to solve it.

Why using CrossEntropyLoss

Hello @yu4u

May I ask what is the reason of using CrossEntropyLoss instead of MSE/MAE ? From my understanding, age can go beyond 100, and therefore, MSE/MAE loss should be the better criteria for this problem ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.