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

Unable to download the pre-trained models #86

Open
t-naveenkumar opened this issue Mar 8, 2019 · 11 comments
Open

Unable to download the pre-trained models #86

t-naveenkumar opened this issue Mar 8, 2019 · 11 comments

Comments

@t-naveenkumar
Copy link

I am unable to download trained models using download.sh. I am getting following error

`Resolving s3.us-east-2.amazonaws.com (s3.us-east-2.amazonaws.com)... 52.219.104.210
Connecting to s3.us-east-2.amazonaws.com (s3.us-east-2.amazonaws.com)|52.219.104.210|:443... connected.
WARNING: cannot verify s3.us-east-2.amazonaws.com's certificate, issued by â/C=US/ST=California/O=Zscaler Inc./OU=Zscaler Inc./CN=Zscaler Intermediate Root CA (zscloud.net) (t) â:
Unable to locally verify the issuer's authority.
HTTP request sent, awaiting response... 403 Forbidden
2019-03-08 09:44:03 ERROR 403: Forbidden.

tar (child): weights.tar.gz: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now`

please let me know, if you need further information to address this issue

@PiaCuk
Copy link

PiaCuk commented Mar 14, 2019

I get the same error:

~/flownet2-tf/checkpoints$ . download.sh 
--2019-03-14 14:33:33--  https://s3.us-east-2.amazonaws.com/flownetdata/weights.tar.gz
Resolving s3.us-east-2.amazonaws.com (s3.us-east-2.amazonaws.com)... 52.219.80.106
Connecting to s3.us-east-2.amazonaws.com (s3.us-east-2.amazonaws.com)|52.219.80.106|:443... connected.
HTTP request sent, awaiting response... 403 Forbidden
2019-03-14 14:33:33 ERROR 403: Forbidden.

tar (child): weights.tar.gz: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now

@Iamanorange
Copy link

@t-naveenkumar @PiaCuk
#62

@PiaCuk
Copy link

PiaCuk commented Mar 14, 2019

Thank you for the quick response!

@PiaCuk
Copy link

PiaCuk commented Apr 12, 2019

Look at @Iamanorange 's answer, there is a backup for downloading the weights.

@lixiaolusunshine
Copy link

i got the same erro please tell me how to download the fiels?

@Iamanorange
Copy link

#62

@lixiaolusunshine
Copy link

I am unable to download trained models using download.sh. I am getting following error

`Resolving s3.us-east-2.amazonaws.com (s3.us-east-2.amazonaws.com)... 52.219.104.210
Connecting to s3.us-east-2.amazonaws.com (s3.us-east-2.amazonaws.com)|52.219.104.210|:443... connected.
WARNING: cannot verify s3.us-east-2.amazonaws.com's certificate, issued by â/C=US/ST=California/O=Zscaler Inc./OU=Zscaler Inc./CN=Zscaler Intermediate Root CA (zscloud.net) (t) â:
Unable to locally verify the issuer's authority.
HTTP request sent, awaiting response... 403 Forbidden
2019-03-08 09:44:03 ERROR 403: Forbidden.

tar (child): weights.tar.gz: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now`

please let me know, if you need further information to address this issue
I have encountered the same problem, have you solved it ? I can't run this code

@Iamanorange
Copy link

作者给的AWS挂掉了,我做了两个备份,你可以从这两个备份下载训练好的权重。
https://drive.google.com/file/d/1cft8EvnsBL5w4-REUeAaVWLeRx39hyHE/view?usp=sharing
https://mega.nz/#!xk5DVYwB!hG2u_3ho8LWJl660Z5e0z-C0SlytB4SvlSkuoLEd568

@LiuzhuForFun
Copy link

@Iamanorange Could you please solve some bugs of my codes?Or Can you give me the code you test the performance of KITTI.Thanks a lot for your contribution of the research on optical flow.I modified the code from DFNet,but I can't get the same result the paper reported.My code like this:`
from future import division
import cv2
import tensorflow as tf
import numpy as np
import os
import PIL.Image as pil
import png
import scipy
from ..training_schedules import LONG_SCHEDULE

from .flownet_c import FlowNetC
from ..flowlib import flow_to_image, write_flow
from scipy.misc import imread, imsave
import uuid
flags = tf.app.flags
flags.DEFINE_integer("batch_size", 1, "The size of of a sample batch")
flags.DEFINE_integer("img_height", 384, "Image height")
flags.DEFINE_integer("img_width", 1280, "Image width")
flags.DEFINE_string("dataset_dir", '', "Dataset directory")
flags.DEFINE_string("output_dir", None, "Output directory")
flags.DEFINE_string("ckpt_file", '', "checkpoint file")
FLAGS = flags.FLAGS

FLOW_SCALE = 5.0

if 'train' in FLAGS.dataset_dir:
NUM = 194
elif 'test' in FLAGS.dataset_dir:
NUM = 195

def get_flow(path):
bgr = cv2.imread(path, cv2.IMREAD_ANYCOLOR | cv2.IMREAD_ANYDEPTH)
invalid = bgr[:, :, 0] == 0
out_flow = (bgr[:, :, 2:0:-1].astype('f4') - 2**15) / 64.
out_flow[invalid] = 0
return out_flow, bgr[:, :, 0]

def compute_flow_error(gt_flow, pred_flow, mask):
H, W, _ = gt_flow.shape
print(pred_flow.shape)
old_H, old_W, _ = pred_flow.shape

# Reshape predicted flow to have same size as ground truth
pred0 = cv2.resize(pred_flow[:,:,0], (W, H), interpolation=cv2.INTER_LINEAR) * (1.0*W/old_W)
pred1 = cv2.resize(pred_flow[:,:,1], (W, H), interpolation=cv2.INTER_LINEAR) * (1.0*H/old_H)
pred = np.stack((pred0, pred1), axis=-1) * FLOW_SCALE

err = np.sqrt(np.sum(np.square(gt_flow - pred), axis=-1))
err_valid = np.sum(err * mask) / np.sum(mask)
return err_valid, pred

def write_flow_png(name, flow):
H, W, _ = flow.shape
out = np.ones((H, W, 3), dtype=np.uint64)
out[:,:,1] = np.minimum(np.maximum(flow[:,:,1]*64.+215, 0), 216).astype(np.uint64)
out[:,:,0] = np.minimum(np.maximum(flow[:,:,0]*64.+215, 0), 216).astype(np.uint64)
with open(name, 'wb') as f:
writer = png.Writer(width=W, height=H, bitdepth=16)
im2list = out.reshape(-1, out.shape[1]*out.shape[2]).tolist()
writer.write(f, im2list)

def pick_frame(path):
new_files = []
# flow2012 dataset only has 194 pairs
for i in range(NUM):
frame1 = os.path.join(path, 'colored_0', '{:06d}'.format(i) + '_10.png')
frame2 = os.path.join(path, 'colored_0', '{:06d}'.format(i) + '_11.png')
new_files.append([frame1, frame2])
return new_files

def main(_):
new_files = pick_frame(FLAGS.dataset_dir)
basename = os.path.basename(FLAGS.ckpt_file)

im1_pl = tf.placeholder(dtype=tf.float32, shape=(1, FLAGS.img_height, FLAGS.img_width, 3))
im2_pl = tf.placeholder(dtype=tf.float32, shape=(1, FLAGS.img_height, FLAGS.img_width, 3))
model =FlowNetC()
inputs = {
    'input_a': im1_pl,
    'input_b': im2_pl,
}
pred_flows = model.model(inputs, training_schedule=LONG_SCHEDULE)

saver = tf.train.Saver([var for var in tf.all_variables()])
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
errs = np.zeros(NUM)

if not FLAGS.output_dir is None and not os.path.exists(FLAGS.output_dir):
    os.makedirs(FLAGS.output_dir)

with tf.Session(config=config) as sess:
    saver.restore(sess, FLAGS.ckpt_file)
    # For val set
    for t in range(0, len(new_files)):
        if t % 100 == 0:
            print('processing %s: %d/%d' % (basename, t, len(new_files)))
        raw_im0 = pil.open(new_files[t][0])
        raw_im1 = pil.open(new_files[t][1])
        scaled_im0 = raw_im0.resize((FLAGS.img_width, FLAGS.img_height), pil.ANTIALIAS)
        scaled_im1 = raw_im1.resize((FLAGS.img_width, FLAGS.img_height), pil.ANTIALIAS)
    
        
        scaled_im0 = (np.expand_dims(np.array(scaled_im0), axis=0).astype(np.float32))/255.
        scaled_im1 = (np.expand_dims(np.array(scaled_im1), axis=0).astype(np.float32))/255.
        feed_dict = {im1_pl: scaled_im0, im2_pl: scaled_im1}
        pred_flows_val = sess.run(pred_flows, feed_dict=feed_dict)
        pred_flow_val = pred_flows_val['flow']

  
        if 'train' in FLAGS.dataset_dir:
            # no occlusion
            #gt_flow, mask = get_flow(new_files[t][0].replace('colored_0', 'flow_noc'))
            # all
            gt_flow, mask = get_flow(new_files[t][0].replace('colored_0', 'flow_occ'))
            errs[t], scaled_pred = compute_flow_error(gt_flow, pred_flow_val[0,:,:,:], mask)
            unique_name = 'flow-' + str(uuid.uuid4())
            flow_img = flow_to_image(pred_flow_val[0,:,:,:])
            full_out_path = os.path.join(unique_name + '.png')
            imsave(full_out_path, flow_img)

        # Save for eval
        if 'test' in FLAGS.dataset_dir:
            _, scaled_pred = compute_flow_error(np.array(raw_im0)[:,:,:2], pred_flow_val[0,:,:,:], np.array(raw_im0)[:,:,0])
            png_name = os.path.join(FLAGS.output_dir, new_files[t][0].split('/')[-1])
            write_flow_png(png_name, scaled_pred)

        # Save for visual colormap
        if not 'test' in FLAGS.dataset_dir and not FLAGS.output_dir is None:
            # flow_im = flow_to_image(scaled_pred)
            png_name = os.path.join(FLAGS.output_dir, new_files[t][0].split('/')[-1]).replace('png', 'jpg')
            # cv2.imwrite(png_name, flow_im[:,:,::-1])

    print('{:>10}'.format('(valid) endpoint error'))
    print('{:10.4f}'.format(errs.mean()))

if name == 'main':
tf.app.run()`

@XiaowanLi2018
Copy link

作者给的AWS挂掉了,我做了两个备份,你可以从这两个备份下载训练好的权重。
https://drive.google.com/file/d/1cft8EvnsBL5w4-REUeAaVWLeRx39hyHE/view?usp=sharing
https://mega.nz/#!xk5DVYwB!hG2u_3ho8LWJl660Z5e0z-C0SlytB4SvlSkuoLEd568

您好,这两个权重备份是不是打包方式有问题,我下载之后显示无法解压,报错info如下
Archive: checkpoint.zip
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of checkpoint.zip or
checkpoint.zip.zip, and cannot find checkpoint.zip.ZIP, period.

@a726
Copy link

a726 commented Sep 19, 2019

作者给的AWS挂掉了,我做了两个备份,你可以从这两个备份下载训练好的权重。
https://drive.google.com/file/d/1cft8EvnsBL5w4-REUeAaVWLeRx39hyHE/view?usp=sharing
https://mega.nz/#!xk5DVYwB!hG2u_3ho8LWJl660Z5e0z-C0SlytB4SvlSkuoLEd568

您好,这两个权重备份好像失效了,您能不能给我分享一份,非常感谢。QQ306835421

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants