Lesson3-head-pose.ipynb: Creating a dataset+

Hi, when running the below code to create a dataset and get such errors, how to fix this issue/error? thanks.

Bintao Li

The code:
data = (PointsItemList.from_folder(path)

    .split_by_valid_func(lambda o: o.parent.name=='13')

    .label_from_func(get_ctr)

    .transform(get_transforms(), tfm_y=True, size=(120,160))

    .databunch().normalize(imagenet_stats)

   )

The errors:
Exception: It’s not possible to apply those transforms to your dataset:

Expected object of scalar type Double but got scalar type Float for argument #3 ‘mat2’ in call to _th_addmm_out

Hi, bintao li
Try to change the

transform(get_transforms(), tfm_y=True, size=(120,160))

to be:

transform(get_transforms(), tfm_y=True, size=(120,120))

If the thing in above does not work, try to change it to be size=(60, 60)

Hi JonathanSum, thanks for response. However, it does not work for both size(120,120) and (60,60)(for the same issue). There is something wrong with the source code?

Best,

Bintao li

Here is mine that works on colab:
https://colab.research.google.com/drive/1TNv8pSnNW_iH3e9kQk9XQj0_n9wzF8C3?usp=sharing
lbt, if you really want people to help you, please share your full code( reproduction code that has your error). I will try to run them on colab and try to find out the error in my free time.

Here is what I used:

data = (PointsItemList.from_folder(path)
    .split_by_valid_func(lambda o: o.parent.name=='13')
    .label_from_func(get_ctr)
    .transform(get_transforms(), tfm_y=True, size=(120,160))
    .databunch().normalize(imagenet_stats)
   )

Hi JonathanSum, thanks!
My strategy is to run all notebooks of Part 2 (to have a big picture/feeling about it) and then come back to figure out some errors/issues.

Sorry for my late response.
Please check the sharing link for you reference:
https://colab.research.google.com/drive/1hRWIcDBlpJ3PKrg-G-UZp78YTHqCLlix?usp=sharing