Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pretrained weights for raft_small from original paper #5070

Merged
merged 9 commits into from
Dec 9, 2021

Conversation

NicolasHug
Copy link
Member

@NicolasHug NicolasHug commented Dec 8, 2021

Towards #4644

This PR adds pretrained weights for raft-small from the original paper (raft-small.pth).

I will override the default weights with outs later (likely tomorrow) when the training is finished.

both --weights Raft_Small_Weights.C_T_V1 and --pretrained work properly:

(raft) ➜  vision git:(raft_pretrained_CT_small) ✗ torchrun --nproc_per_node 8 --nnodes 1 references/optical_flow/train.py --val-dataset sintel --batch-size 10 --dataset-root /data/home/nicolashug/cluster/work/downloads --model raft_small --weights Raft_Small_Weights.C_T_V1

Batch-processed 1040 / 1041 samples. Going to process the remaining samples individually, if any.
Sintel val clean epe: 2.1208	1px: 0.8486	3px: 0.9305	5px: 0.9498	per_image_epe: 2.1236	f1: 6.6777
Sintel val final Total time: 0:00:09
Batch-processed 1040 / 1041 samples. Going to process the remaining samples individually, if any.
Sintel val final epe: 3.2727	1px: 0.8075	3px: 0.8969	5px: 0.9225	per_image_epe: 3.2617	f1: 9.9382

Conversion code for ref:

def map_orig_to_ours_small(orig, mine=None):
    # TODO: remove
    d = {}
    used_s_orig = set()
    used_s_mine = set()

    def assert_and_add(s_orig, s_mine):
        # print(s_orig, s_mine)
        # print(orig[s_orig].shape, mine[s_mine].shape)

        assert s_orig not in used_s_orig, s_orig
        assert s_mine not in used_s_mine, s_mine

        if mine is not None:
            assert s_mine in mine, s_mine
        assert s_orig in orig
        if mine is not None:
            assert orig[s_orig].shape == mine[s_mine].shape
        d[s_mine] = orig[s_orig]
        used_s_orig.add(s_orig)
        used_s_mine.add(s_mine)
    
    for a, b in zip(orig, mine):
        assert_and_add(a, b)

    if mine is not None:
        print(len(d), len(orig), len(mine))
        assert not (set(mine.keys()) - set(d.keys()))
    return d

cc @datumbox

@facebook-github-bot
Copy link

facebook-github-bot commented Dec 8, 2021

💊 CI failures summary and remediations

As of commit 55d1cde (more details on the Dr. CI page):


  • 1/1 failures introduced in this PR

🕵️ 1 new failure recognized by patterns

The following CI failures do not appear to be due to upstream breakages:

See CircleCI build unittest_linux_cpu_py3.8 (1/1)

Step: "Run tests" (full log | diagnosis details | 🔁 rerun)

/root/project/torchvision/io/video.py:399: Runt...log: [mov,mp4,m4a,3gp,3g2,mj2] moov atom not found

test/test_internet.py::TestDatasetUtils::test_download_url_dont_exist
  /root/project/env/lib/python3.8/site-packages/_pytest/fixtures.py:928: ResourceWarning: unclosed <ssl.SSLSocket [closed] fd=13, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6>
    finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator)

test/test_internet.py::TestDatasetUtils::test_download_url_dont_exist
  /root/project/env/lib/python3.8/site-packages/_pytest/fixtures.py:928: ResourceWarning: unclosed <ssl.SSLSocket [closed] fd=14, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6>
    finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator)

test/test_io.py::TestVideo::test_read_video_timestamps_corrupted_file
  /root/project/torchvision/io/video.py:399: RuntimeWarning: Failed to open container for /tmp/tmp5ufjmbrm.mp4; Caught error: [Errno 1094995529] Invalid data found when processing input: '/tmp/tmp5ufjmbrm.mp4'; last error log: [mov,mp4,m4a,3gp,3g2,mj2] moov atom not found
    warnings.warn(msg, RuntimeWarning)

test/test_models.py::test_memory_efficient_densenet[densenet121]
test/test_models.py::test_memory_efficient_densenet[densenet169]
test/test_models.py::test_memory_efficient_densenet[densenet201]
test/test_models.py::test_memory_efficient_densenet[densenet161]
  /root/project/env/lib/python3.8/site-packages/torch/autocast_mode.py:162: UserWarning: User provided device_type of 'cuda', but CUDA is not available. Disabling
    warnings.warn('User provided device_type of \'cuda\', but CUDA is not available. Disabling')

test/test_models.py::test_inception_v3_eval

This comment was automatically generated by Dr. CI (expand for details).

Please report bugs/suggestions to the (internal) Dr. CI Users group.

Click here to manually regenerate this comment.

Copy link
Contributor

@datumbox datumbox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@NicolasHug NicolasHug merged commit 48e2f23 into pytorch:main Dec 9, 2021
facebook-github-bot pushed a commit that referenced this pull request Dec 17, 2021
…5070)

Reviewed By: fmassa

Differential Revision: D33184999

fbshipit-source-id: 337221d0b132092c97b10d9537aead6f5d122ff8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants